From 9d52aa3b355449a0186eeb7ee497ae8ad7de507f Mon Sep 17 00:00:00 2001 From: Shinrai Date: Sun, 2 Aug 2026 23:17:13 -0700 Subject: [PATCH] chore: rename test files to *.test.vitest.mjs suffix Aligns wol-proxy with the fleet-wide convention that vitest test files are always named *.test.vitest.mjs, updating the vitest config include glob and the run-vitest.mjs harness's testFilePattern to match. --- .configs/vitest.config.mjs | 2 +- tests/{port-fallback.test.mjs => port-fallback.test.vitest.mjs} | 2 +- tests/run-vitest.mjs | 2 +- tests/{wake-endpoint.test.mjs => wake-endpoint.test.vitest.mjs} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename tests/{port-fallback.test.mjs => port-fallback.test.vitest.mjs} (96%) rename tests/{wake-endpoint.test.mjs => wake-endpoint.test.vitest.mjs} (100%) diff --git a/.configs/vitest.config.mjs b/.configs/vitest.config.mjs index fd5fc29..6665771 100644 --- a/.configs/vitest.config.mjs +++ b/.configs/vitest.config.mjs @@ -7,7 +7,7 @@ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); export default defineConfig({ root, test: { - include: ["tests/**/*.test.mjs"], + include: ["tests/**/*.test.vitest.mjs"], exclude: ["node_modules"], environment: "node", testTimeout: 30000, diff --git a/tests/port-fallback.test.mjs b/tests/port-fallback.test.vitest.mjs similarity index 96% rename from tests/port-fallback.test.mjs rename to tests/port-fallback.test.vitest.mjs index af99ee3..d80ccff 100644 --- a/tests/port-fallback.test.mjs +++ b/tests/port-fallback.test.vitest.mjs @@ -4,7 +4,7 @@ * const port = process.env.PORT || 3000; * app.listen(port, '0.0.0.0', () => console.log(`WOL proxy on port ${port}`)); * - * `tests/wake-endpoint.test.mjs` covers the `process.env.PORT` (truthy) branch by + * `tests/wake-endpoint.test.vitest.mjs` covers the `process.env.PORT` (truthy) branch by * setting `PORT=0` for an ephemeral real bind. This file covers the `|| 3000` * fallback branch (PORT unset) in a separate process (the OOM-safe runner spawns * one vitest child process per test file, so env vars and the CJS `require.cache` diff --git a/tests/run-vitest.mjs b/tests/run-vitest.mjs index d6c32ba..8dbdb5e 100644 --- a/tests/run-vitest.mjs +++ b/tests/run-vitest.mjs @@ -26,7 +26,7 @@ const code = await run({ cwd: root, testDir: "tests", vitestConfig: ".configs/vitest.config.mjs", - testFilePattern: /\.test\.mjs$/, + testFilePattern: /\.test\.vitest\.mjs$/, testPatterns, workers, coverageQuiet, diff --git a/tests/wake-endpoint.test.mjs b/tests/wake-endpoint.test.vitest.mjs similarity index 100% rename from tests/wake-endpoint.test.mjs rename to tests/wake-endpoint.test.vitest.mjs