chore(deps): vitest 4
vitest 3.2.7 carried the last three dev audit advisories: tinypool (critical, prototype pollution to RCE in worker options), vitest itself (critical, through tinypool and @vitest/mocker) and @vitest/mocker (moderate, path traversal through a redirected mock). 4.1.11 is the first stable release outside every affected range; vitest 4 no longer depends on tinypool at all. It needs Node 20 or newer, which the Node 22 floor now guarantees. vitest 5 would need Node 22.12, and 4.1.11 is enough to clear the advisories. vite stays on ^6.4.3, which vitest 4 accepts. The one change the bump requires: vitest 4 types `vi.fn()` with no arguments as a mock of a function *or* a constructor, so `ReturnType<typeof vi.fn>` is no longer callable as a plain function. listener-boundary.test.ts now types its spies as `Mock<(...args: unknown[]) => void>`. npm 10.9 crashes in arborist's #loadPeerSet resolving this tree, so the lockfile was produced with npm 11.6.2; `npm ci` on Node 22's bundled npm 10 installs it cleanly. npm audit: 3 -> 0. npm audit --omit=dev stays at 0. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
4 files changed
+156
-198
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi, type Mock } from 'vitest';
|
||||
import http from 'node:http';
|
||||
import net from 'node:net';
|
||||
import { once } from 'node:events';
|
||||
@@ -39,7 +39,7 @@ function get(port: number, path: string, headers: Record<string, string> = {}):
|
||||
});
|
||||
}
|
||||
|
||||
function spyLogger(): Logger & { error: ReturnType<typeof vi.fn> } {
|
||||
function spyLogger(): Logger & { error: Mock<(...args: unknown[]) => void> } {
|
||||
return { debug: vi.fn(), info: vi.fn(), warn: vi.fn(), error: vi.fn() };
|
||||
}
|
||||
|
||||
@@ -69,8 +69,8 @@ async function expectServerStillServes(port: number): Promise<void> {
|
||||
|
||||
const settle = () => new Promise((r) => setTimeout(r, 20));
|
||||
|
||||
let unhandled: ReturnType<typeof vi.fn>;
|
||||
let uncaught: ReturnType<typeof vi.fn>;
|
||||
let unhandled: Mock<(...args: unknown[]) => void>;
|
||||
let uncaught: Mock<(...args: unknown[]) => void>;
|
||||
|
||||
beforeEach(() => {
|
||||
unhandled = vi.fn();
|
||||
|
||||
Reference in new issue
Block a user