-
-
Notifications
You must be signed in to change notification settings - Fork 752
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
DavertMik
left a comment
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
initsynchronous without callback - add
bootstrapexecution torun-multiplecommand
lib/codecept.js
Outdated
| * @param {() => any} [done] | ||
| */ | ||
| 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
DavertMik
left a comment
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
initsynchronous without callback - add
bootstrapexecution torun-multiplecommand - 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 defandcodeceptjs listBefore, bootstrap has started (and set up connection to browserstack, for example) before
defcommand, which is unnecessary.Also, teardown has started after these commands.
TypeError: done is not a functionerror occurred.