Skip to content

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

Merged
tgriesser merged 14 commits into
mainfrom
tgriesser/feat/convert-tests-to-vitest-fix-leaks
Jun 26, 2026
Merged

feat: convert tests to vitest, address timer/promise leaks#1
tgriesser merged 14 commits into
mainfrom
tgriesser/feat/convert-tests-to-vitest-fix-leaks

Conversation

@tgriesser

Copy link
Copy Markdown
Member

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 merged commit 7d2245c into main Jun 26, 2026
3 checks passed
@tgriesser tgriesser deleted the tgriesser/feat/convert-tests-to-vitest-fix-leaks branch June 26, 2026 14:41
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