From f36bfb93e99ce74a0ebcf88a0849309bf0fa4d95 Mon Sep 17 00:00:00 2001 From: KobeN <7845001+kobenguyent@users.noreply.github.com> Date: Thu, 7 Mar 2024 11:34:38 +0100 Subject: [PATCH] fix: some methods to adapt with codeceptjs --- src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9f7c897..d08a9e9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -178,7 +178,7 @@ class Helper { get helpers() { // @ts-ignore const { container } = global.codeceptjs || require('codeceptjs'); - return container.helpers(); + return container.default ? container.default.helpers() :container.helpers(); } /** @@ -189,7 +189,7 @@ class Helper { debug(msg: string) { // @ts-ignore const { output } = global.codeceptjs || require('codeceptjs'); - output.debug(msg); + output.output ? output.output.debug(msg) : output.debug(msg); } /** @@ -199,8 +199,8 @@ class Helper { debugSection(section: any, msg: string) { // @ts-ignore const { output } = global.codeceptjs || require('codeceptjs'); - output.debug(`[${section}] ${msg}`); + output.output ? output.output.debug(`[${section}] ${msg}`) : output.debug(`[${section}] ${msg}`); } } -export = Helper; \ No newline at end of file +export = Helper;