From 2a0bb2c62be525c91bc9692ab415cc1e97553fe3 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Sun, 26 Apr 2026 16:02:13 +0200 Subject: [PATCH] build(test): wire pnpm test to vitest, drop redundant test:vitest CI step src/package.json: - test: was mocha --import=tsx --recursive ...; now `vitest run` (vitest.config already includes tests/backend/specs, tests/backend-new/specs, and tests/container/specs) - test-utils: vitest run with --testTimeout 5000 - test-container: vitest run tests/container/specs/api - test:vitest renamed to test:watch (watch mode for local dev) .github/workflows/backend-tests.yml: - removed the redundant 'Run the new vitest tests' step from all 4 jobs since pnpm test now runs vitest itself --- .github/workflows/backend-tests.yml | 12 ------------ src/package.json | 8 ++++---- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index e3cbf9365..0042f0483 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -68,9 +68,6 @@ jobs: - name: Run the backend tests run: pnpm test - - name: Run the new vitest tests - working-directory: src - run: pnpm run test:vitest withpluginsLinux: env: @@ -137,9 +134,6 @@ jobs: - name: Run the backend tests run: pnpm test - - name: Run the new vitest tests - working-directory: src - run: pnpm run test:vitest # Windows tests only run on push to develop/master, not on PRs withoutpluginsWindows: @@ -189,9 +183,6 @@ jobs: name: Run the backend tests working-directory: src run: pnpm test - - name: Run the new vitest tests - working-directory: src - run: pnpm run test:vitest withpluginsWindows: env: @@ -267,6 +258,3 @@ jobs: name: Run the backend tests working-directory: src run: pnpm test - - name: Run the new vitest tests - working-directory: src - run: pnpm run test:vitest diff --git a/src/package.json b/src/package.json index ea8ae7748..908502255 100644 --- a/src/package.json +++ b/src/package.json @@ -145,9 +145,9 @@ }, "scripts": { "lint": "eslint .", - "test": "cross-env NODE_ENV=production mocha --import=tsx --timeout 120000 --recursive tests/backend/specs/**.ts ../node_modules/ep_*/static/tests/backend/specs/**", - "test-utils": "cross-env NODE_ENV=production mocha --import=tsx --timeout 5000 --recursive tests/backend/specs/*utils.ts", - "test-container": "mocha --import=tsx --timeout 5000 tests/container/specs/api", + "test": "cross-env NODE_ENV=production vitest run", + "test-utils": "cross-env NODE_ENV=production vitest run tests/backend/specs --testTimeout 5000", + "test-container": "cross-env NODE_ENV=production vitest run tests/container/specs/api", "dev": "cross-env NODE_ENV=development node --import tsx node/server.ts", "prod": "cross-env NODE_ENV=production node --import tsx node/server.ts", "ts-check": "tsc --noEmit", @@ -157,7 +157,7 @@ "test-admin": "cross-env NODE_ENV=production npx playwright test tests/frontend-new/admin-spec --workers 1 --project=chromium", "test-admin:ui": "cross-env NODE_ENV=production npx playwright test tests/frontend-new/admin-spec --ui --workers 1", "debug:socketio": "cross-env DEBUG=socket.io* node --import tsx node/server.ts", - "test:vitest": "vitest" + "test:watch": "cross-env NODE_ENV=production vitest" }, "version": "2.7.2", "license": "Apache-2.0"