From b36273d8fc46d7f7e56744d28f641e950ebc487f Mon Sep 17 00:00:00 2001 From: PeterNgTr Date: Thu, 31 Oct 2019 16:19:45 +0100 Subject: [PATCH 1/2] fix error when importing actionwords --- .gitignore | 4 ++++ features/step_definitions.js | 8 +------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index ad46b30..22aaa94 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ build/Release # Dependency directories node_modules/ jspm_packages/ +package-lock.json # TypeScript v1 declaration files typings/ @@ -59,3 +60,6 @@ typings/ # next.js build output .next + +# codeceptjs +output/* diff --git a/features/step_definitions.js b/features/step_definitions.js index b6707bb..8e64722 100644 --- a/features/step_definitions.js +++ b/features/step_definitions.js @@ -1,10 +1,4 @@ -const { I } = inject(); -let actionwords; - -Before(() => { - actionwords = Object.create(require('./actionwords.js')).Actionwords; -}); - +let actionwords = require('./actionwords.js').Actionwords;; When(/^I start the coffee machine using language "(.*)"$/, function (lang) { return actionwords.iStartTheCoffeeMachineUsingLanguageLang(lang); From f9c24553e0625a13c75526f34704f831c93a2046 Mon Sep 17 00:00:00 2001 From: PeterNgTr Date: Thu, 31 Oct 2019 16:43:53 +0100 Subject: [PATCH 2/2] fix template --- templates/javascript/codeceptjs/actionwords.hbs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/templates/javascript/codeceptjs/actionwords.hbs b/templates/javascript/codeceptjs/actionwords.hbs index 7a3410b..7124b3a 100644 --- a/templates/javascript/codeceptjs/actionwords.hbs +++ b/templates/javascript/codeceptjs/actionwords.hbs @@ -1,9 +1,5 @@ const {{#curly}} I {{/curly}} = inject(); -let actionwords; - -Before(() => {{#curly}}{{#indent}} -actionwords = Object.create(require('{{{ relative_path './actionwords.js' }}}')).Actionwords;{{/indent}} -{{/curly}}); +let actionwords = require('{{{ relative_path './actionwords.js' }}}').Actionwords;{{/indent}} {{#each rendered_children.actionwords}}{{{this}}} {{/each}} \ No newline at end of file