-
-
Notifications
You must be signed in to change notification settings - Fork 741
Fix/bootstrap starting for def #1270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/bootstrap starting for def #1270
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I have 2 suggestions:
- make
init
synchronous without callback - add
bootstrap
execution torun-multiple
command
lib/codecept.js
Outdated
*/ | ||
bootstrap(done) { | ||
runHooks(done) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like runHooks
are synchronous now, so done
is not needed and callback functions.
Also I'm going to deprecate custom hooks in config so this code should be 100% synchronous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I have 2 suggestions:
- make
init
synchronous without callback - add
bootstrap
execution torun-multiple
command - remove bootstrap from gherkin* commands (as they don't execute tests)
lib/command/gherkin/steps.js
Outdated
} | ||
if (err) throw new Error(`Error while running init :${err}`); | ||
|
||
codecept.runBootstrap((err) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bootstrap should not be run for listing steps definition (as it's not executed for def)
lib/command/gherkin/snippets.js
Outdated
files.push(fsPath.resolve(file)); | ||
}); | ||
output.print(`Loaded ${files.length} files`); | ||
codecept.runBootstrap((err) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gherkin:snippets should not execute bootstrap (as it's omitted for def/list commands as well)
Done 1st and 3rd. About 2nd: |
Awesome, thanks! |
Removed config's bootstrap and teardown calls for
codeceptjs def
andcodeceptjs list
Before, bootstrap has started (and set up connection to browserstack, for example) before
def
command, which is unnecessary.Also, teardown has started after these commands.
TypeError: done is not a function
error occurred.