Status: Open (View Workflow)
Development Team:Core: Platform
**Note: We should selectively update a couple modules and verify results before rolling this out to all.**
The main change is to accept a Nightmare object instantiated outside of the test, rather than creating a new one within each test.
For example, from this:
Also remove any direct calls to .end() on the Nightmare instance within tests. End will be called on the shared instance after all tests are run. This includes use of the logout() helper method which internally calls end. A new helper method, logoutWithoutEnd() has been created to accommodate the transition.
Example, from this:
Finally, although not required, this may be a good opportunity to review and replace our use of arrow functions for the Mocha test scaffolding (describe, it, before, after, etc). Due to the lexically bound this of the arrow function, access to Mohca's context is blocked and therefore not recommended.
For example, rather than this: