Skip to content

feat: convert tests to vitest, address timer/promise leaks#85

Open
tgriesser wants to merge 12 commits into
Vincit:masterfrom
tgriesser:tgriesser/feat/convert-tests-to-vitest-fix-leaks
Open

feat: convert tests to vitest, address timer/promise leaks#85
tgriesser wants to merge 12 commits into
Vincit:masterfrom
tgriesser:tgriesser/feat/convert-tests-to-vitest-fix-leaks

Conversation

@tgriesser
Copy link
Copy Markdown
Collaborator

@tgriesser tgriesser commented Mar 27, 2026

While working on knex/knex#6413 and trying out Vitest's detectAsyncLeaks I noticed that there were leaks that seemed to be coming from the connection pool even after destroy was called

This converts the tests over to using vitest to make use of the detectAsyncLeaks which is especially important for this library. We can test as low as Node 16 with an earlier versions of vitest (thanks @kibertoad for the suggestion there).

It seems like a lot of lines, but when you look at the diff it's not bad, mostly cosmetic related to some minor differences in chai syntax.

Also by compiling with TS 5 we get rid of the generated /// <reference types="node" /> due to switching to ReturnType<typeof setTimeout> | ReturnType<typeof setInterval> so @types/node is no longer needed as an actual dependency.

@tgriesser tgriesser requested a review from koskimas March 27, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant