-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI doesn't exit on Node 15+ #124
Comments
This error seems to happen on Node 15.14.0 too. |
It's happening to me too on Node 16.8 |
Workaround: test.after(() => {
setTimeout(() => {
process.exit(0)
}, 500)
}) |
This almost always means a non-uvu asynchronous task is still running / not terminated properly. uvu (currently) only exits once all suites have completed |
You are right @lukeed, turns out I wasn't closing my websocket connection on test.after() |
FYI, @thelinuxlich's workaround works but when you get more and more suites to run, you'll need a couple setups (via the import type { Context } from 'uvu';
const queue: Map<string, Context> = new Map();
// Use it with the 'before' hook.
export const registerSuite = (ctx: Context) => { queue.set(ctx.__suite__, ctx) };
// Use it with the 'after' hook.
export const cleanupSuite = (ctx: Context) => {
setTimeout(() => {
queue.delete(ctx.__suite__);
if (queue.size === 0) { process.exit() }
}, 500);
}; |
Closing since this was an issue with the code execution & not uvu directly. Linking #138 since I may still consider adding a |
Originally encountered this issue on Azure Pipelines while testing a project based on React, UVU,
esbuild-register
,@testing-library/react
andjsdom
, using Node 12-14-16.4.0.I could reproduce it on this
uvu-jsdom-node-16-repro
repo. In Github Actions logs, tests seem to pass in Node 16.4.0 but it doesn't exit (note that I've set up up a 1-minute timeout).A notable difference I've seen during my tests is React displays a warning about
requestAnimationFrame
andcancelAnimationFrame
only on the Node 16.4.0 related test, so I'm not entirely sure this is an UVU/sade or JSDOM or React issue.The text was updated successfully, but these errors were encountered: