diff --git a/package.json b/package.json index 8f363871..eb62d3ef 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "start:ff": "node tools/launch-ff.mjs", "start:ff:fresh": "node tools/launch-ff-fresh.mjs", "start:ff:clean": "web-ext run --source-dir=build_firefox_github --target=firefox-desktop", - "test": "vitest run", + "test": "node tools/sync-vendor.mjs && vitest run", "test:watch": "vitest", "test:coverage": "vitest run --coverage", "test:workflows": "bash tests/workflows/run.sh", diff --git a/tools/sync-vendor.mjs b/tools/sync-vendor.mjs index 495f4b5e..4f450cbb 100644 --- a/tools/sync-vendor.mjs +++ b/tools/sync-vendor.mjs @@ -11,7 +11,7 @@ // so a reviewer can check the base by hash and read the diff in minutes. // // The generated files are gitignored. Run after `pnpm install`, or let -// `pnpm run build` do it. +// `pnpm run build` or `pnpm test` do it. import fs from 'node:fs'; import path from 'node:path'; diff --git a/vitest.config.mjs b/vitest.config.mjs index cacbeeec..ce28312c 100644 --- a/vitest.config.mjs +++ b/vitest.config.mjs @@ -2,8 +2,10 @@ import path from 'node:path'; import {defineConfig} from 'vitest/config'; // Libraries tools/sync-vendor.mjs copies out of node_modules unchanged (patched by pnpm at -// install). The copies are generated, and CI runs the unit tests before it makes them, so a -// test of code that imports one (the save's MP4 writers) gets the npm build itself. +// install). A test of code that imports one (the save's MP4 writers) gets the npm build itself. +// `pnpm test` also makes the copies first: in one local checkout this redirect was not +// called (2026-11-09), and the unit tests there ran on copies from before a dependency +// update (31 failures in hls2mp4 until a build). const root = import.meta.dirname; const VENDORED = new Map([ ['chrome/player/modules/hls.mjs', 'node_modules/hls.js/dist/hls.mjs'],