fix(frameworks): make mocha globals available on onPrepare, similarly to how it works on other frameworks#4484
fix(frameworks): make mocha globals available on onPrepare, similarly to how it works on other frameworks#4484ronami wants to merge 1 commit intoangular:masterfrom ronami:master
Conversation
… to how it works on other frameworks
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
1 similar comment
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
I signed it! |
|
CLAs look good, thanks! |
1 similar comment
|
CLAs look good, thanks! |
Mocha globals are not available when
onPrepareis run. This prevents proper setup usingbefore,afteror other Mocha globals.Mocha's
loadFiles()method makes its globals available if any test files have been added. CallingloadFiles()before adding any test files is noop (see here, and here).This change adds the test files before calling
mocha.loadFiles()so it actually loads files, and thus, making these globals available duringonPrepareand matching the waymochaworks to other frameworks.This change is backward compatible and matches the way other frameworks work within
Protractor.