Closed
Description
Current documentation says that each test file is run in a separate Node.js process:
## Process isolation
Each test file is run in a separate Node.js process. This allows you to change the global state or overriding a built-in in one test file, without affecting another. It's also great for performance on modern multi-core processors, allowing multiple test files to execute in parallel.
AVA will set process.env.NODE_ENV to test, unless the NODE_ENV environment variable has been set. This is useful if the code you're testing has test defaults (for example when picking what database to connect to, or environment-specific Babel options). It may cause your code or its dependencies to behave differently though. Note that 'NODE_ENV' in process.env will always be true.
However, this implies that there is no isolation between tests in the same file.
This affects use of mocking modules such as nock
that modify the global http.request
.
I suggest adding an option for test-level isolation.
Metadata
Metadata
Assignees
Labels
No labels