Open
Description
- I'd be willing to submit the fix
Describe the bug
I am upgrading our libraries, so I swapped to mochapack and now I have an issue:
We are having global memory clearing method in cleanUpResources.js
afterEach('Cleanup after test', function () {
// Remove all listeners added by our test
console.log('-- clear --');
listeners.window.forEach((listener) => window.removeEventListener(listener.type, listener.listener));
listeners.document.forEach((listener) => document.removeEventListener(listener.type, listener.listener));
listeners.window = [];
listeners.document = [];
// Restore sinon sandbox
sinon.reset();
sinon.restore();
});
Loading this file using
--include ./test/cleanupResources.js
also using parameter
--opts mochapack.opts
--colors
--recursive
--full-trace
--require mock-local-storage
--require ./test/test_helpers.js
--include ./test/cleanupResources.js
clear and concise description of what the bug is.
when I have the include
inline directly it loads the cleanup file. When I have it in the opts file, it does not.
To Reproduce
You can do the same thing I did... have an --include with some file and in it have afterEach with console.log and check the difference with inline and in opts solution.
Environment if relevant (please complete the following information):
- OS: Linux
- Node version 10.18
├── [email protected]
├── [email protected]
└── [email protected]
Currently I am bypassing this using the inline solution.