Comments (3)
This was discussed here: #3260 (comment)
But I'll use this as the tracking issue.
I run integration tests with a local database and want to keep the database pool open.
Since each test file runs in its own isolated worker thread, I don't think this will make a difference.
In 5.3.1, this worked fine but it breaks after upgrading and no other changes on my end.
Yes this was a change in AVA 6. It's listed under the Breaking Changes in the release notes:
When tests finish, worker threads or child processes are no longer exited through proces.exit(). If your test file does not exit on its own, the test run will time out.
Please enable some kind of way to set up the configuration to forcibly exit and pass if all tests ran & passed
See suggestion at #3260 (comment):
I think a import { registerCompleteHandler } from 'ava' which sets up a function to be called when AVA is done would be a decent solution. You could then registerCompleteHandler(() => process.exit()) and AVA will just assume the test worker exited on its own. This could be in a helper file that is loaded.
Other use cases are as a cleanup routine that sits outside of AVA's test & hook logic. I'm leaning to a solution like this over configuration because configuration implies we can handle edge cases in Node.js and we can't.
from ava.
@croconut let me know if #3283 works for you.
from ava.
@novemberborn thanks a bunch, I'll give this a shot
from ava.
Related Issues (20)
- AVA hangs after all tests pass HOT 2
- Support a proper junit reporter
- Monorepo with babel aliases support HOT 1
- The watch mode does not work in v6 HOT 4
- Ability to run a mixed test code base using node:test HOT 2
- Azure DevOps output handler
- Typescript with VS Code debug issue
- Ava fails to run in watch mode via CLI HOT 2
- Documentation Request: Using a Node Custom Loader
- Add support for `--env-file=` flag for node 20 in `nodeArguments`
- Spurious "previous failures in test files that were not rerun" in watch mode HOT 2
- registerCompletionHandler can't be used in CommonJS project HOT 1
- Allow regexes in `t.like` HOT 2
- failing async test ends in timeout instead of go to catch clause
- `t.throws` doesn't recognize falsy thrown values
- `t.inRange`
- Ava won't work with yarn workspaces package named `business-logic` HOT 1
- Tap reporter outputs internal stack traces HOT 2
- Add support for Node 22 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ava.