You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 globalhttp.request
.I suggest adding an option for test-level isolation.
The text was updated successfully, but these errors were encountered: