From 8c9a8e1876000fbf2eeeef63046eaab12d680222 Mon Sep 17 00:00:00 2001 From: Douglas Winter Date: Fri, 27 Feb 2026 09:41:09 +0000 Subject: [PATCH 1/7] Add v8 coverage provider Also downgrade vitest-conf/RTL to 15 for React 18. --- package.json | 3 +- packages/vitest-conf/package.json | 2 +- pnpm-lock.yaml | 117 ++++++++++++++++++++++++++---- 3 files changed, 106 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 2ffd3d71..fd934b33 100644 --- a/package.json +++ b/package.json @@ -17,13 +17,14 @@ "@eslint/js": "^9.36.0", "@types/react": "^18.3.1", "@types/react-dom": "^18.3.1", + "@vitest/coverage-v8": "^4.0.18", "eslint": "^9.36.0", "prettier": "^3.6.2", "sort-package-json": "^3.4.0", "turbo": "^2.5.6", "typescript": "^5.9.2", "typescript-eslint": "^8.44.1", - "vitest": "^4.0.13" + "vitest": "^4.0.18" }, "packageManager": "pnpm@10.17.1" } diff --git a/packages/vitest-conf/package.json b/packages/vitest-conf/package.json index 1dcb446e..11e2f075 100644 --- a/packages/vitest-conf/package.json +++ b/packages/vitest-conf/package.json @@ -22,7 +22,7 @@ "devDependencies": { "@testing-library/dom": "^10.4.1", "@testing-library/jest-dom": "^6.6.4", - "@testing-library/react": "^16.3.0", + "@testing-library/react": "^15.0.1", "@testing-library/user-event": "^14.6.1", "@types/node": "^25.0.10", "jsdom": "^26.1.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2081a723..fd3cb06f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,6 +24,9 @@ importers: '@types/react-dom': specifier: ^18.3.1 version: 18.3.7(@types/react@18.3.28) + '@vitest/coverage-v8': + specifier: ^4.0.18 + version: 4.0.18(vitest@4.0.18(@types/node@25.3.3)(jsdom@26.1.0(bufferutil@4.1.0)(utf-8-validate@5.0.10))(msw@2.12.10(@types/node@25.3.3)(typescript@5.9.3))) eslint: specifier: ^9.36.0 version: 9.39.3 @@ -43,7 +46,7 @@ importers: specifier: ^8.44.1 version: 8.56.1(eslint@9.39.3)(typescript@5.9.3) vitest: - specifier: ^4.0.13 + specifier: ^4.0.18 version: 4.0.18(@types/node@25.3.3)(jsdom@26.1.0(bufferutil@4.1.0)(utf-8-validate@5.0.10))(msw@2.12.10(@types/node@25.3.3)(typescript@5.9.3)) apps/i15-1: @@ -243,8 +246,8 @@ importers: specifier: ^6.6.4 version: 6.9.1 '@testing-library/react': - specifier: ^16.3.0 - version: 16.3.2(@testing-library/dom@10.4.1)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^15.0.1 + version: 15.0.7(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@testing-library/user-event': specifier: ^14.6.1 version: 14.6.1(@testing-library/dom@10.4.1) @@ -334,6 +337,10 @@ packages: resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==} engines: {node: '>=6.9.0'} + '@bcoe/v8-coverage@1.0.2': + resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} + engines: {node: '>=18'} + '@csstools/color-helpers@5.1.0': resolution: {integrity: sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==} engines: {node: '>=18'} @@ -1276,20 +1283,16 @@ packages: resolution: {integrity: sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==} engines: {node: '>=14', npm: '>=6', yarn: '>=1'} - '@testing-library/react@16.3.2': - resolution: {integrity: sha512-XU5/SytQM+ykqMnAnvB2umaJNIOsLF3PVv//1Ew4CTcpz0/BRyy/af40qqrt7SjKpDdT1saBMc42CUok5gaw+g==} + '@testing-library/react@15.0.7': + resolution: {integrity: sha512-cg0RvEdD1TIhhkm1IeYMQxrzy0MtUNfa3minv4MjbgcYzJAZ7yD0i0lwoPOTPr+INtiXFezt2o8xMSnyHhEn2Q==} engines: {node: '>=18'} peerDependencies: - '@testing-library/dom': ^10.0.0 - '@types/react': ^18.0.0 || ^19.0.0 - '@types/react-dom': ^18.0.0 || ^19.0.0 - react: ^18.0.0 || ^19.0.0 - react-dom: ^18.0.0 || ^19.0.0 + '@types/react': ^18.0.0 + react: ^18.0.0 + react-dom: ^18.0.0 peerDependenciesMeta: '@types/react': optional: true - '@types/react-dom': - optional: true '@testing-library/user-event@14.6.1': resolution: {integrity: sha512-vq7fv0rnt+QTXgPxr5Hjc210p6YKq2kmdziLgnsZGgLJ9e6VAShx1pACLuRjd/AS/sr7phAR58OIIpf0LlmQNw==} @@ -1551,6 +1554,15 @@ packages: peerDependencies: vite: ^4 || ^5 || ^6 || ^7 + '@vitest/coverage-v8@4.0.18': + resolution: {integrity: sha512-7i+N2i0+ME+2JFZhfuz7Tg/FqKtilHjGyGvoHYQ6iLV0zahbsJ9sljC9OcFcPDbhYKCet+sG8SsVqlyGvPflZg==} + peerDependencies: + '@vitest/browser': 4.0.18 + vitest: 4.0.18 + peerDependenciesMeta: + '@vitest/browser': + optional: true + '@vitest/expect@4.0.18': resolution: {integrity: sha512-8sCWUyckXXYvx4opfzVY03EOiYVxyNrHS5QxX3DAIi5dpJAAkyJezHCP77VMX4HKA2LDT/Jpfo8i2r5BE3GnQQ==} @@ -1659,6 +1671,9 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} + ast-v8-to-istanbul@0.3.12: + resolution: {integrity: sha512-BRRC8VRZY2R4Z4lFIL35MwNXmwVqBityvOIwETtsCSwvjl0IdgFsy9NhdaA6j74nUdtJJlIypeRhpDam19Wq3g==} + asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} @@ -2327,6 +2342,9 @@ packages: resolution: {integrity: sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==} engines: {node: '>=18'} + html-escaper@2.0.2: + resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + http-proxy-agent@7.0.2: resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} engines: {node: '>= 14'} @@ -2440,11 +2458,26 @@ packages: resolution: {integrity: sha512-QvUHIbvXZE/N8Mmi0mndfk9KrqsHGE5U20dekg6SaQNY94yteoM+f4M4Dc7AnMjCwwEeHUqKggH8mvtJdSWvsg==} engines: {node: '>= 0.8.0'} + istanbul-lib-coverage@3.2.2: + resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} + engines: {node: '>=8'} + + istanbul-lib-report@3.0.1: + resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} + engines: {node: '>=10'} + + istanbul-reports@3.2.0: + resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==} + engines: {node: '>=8'} + its-fine@1.2.5: resolution: {integrity: sha512-fXtDA0X0t0eBYAGLVM5YsgJGsJ5jEmqZEPrGbzdf5awjv0xE7nqv3TVnvtUF060Tkes15DbDAKW/I48vsb6SyA==} peerDependencies: react: '>=18.0' + js-tokens@10.0.0: + resolution: {integrity: sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==} + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -2551,6 +2584,13 @@ packages: magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + magicast@0.5.2: + resolution: {integrity: sha512-E3ZJh4J3S9KfwdjZhe2afj6R9lGIN5Pher1pF39UGrXRqq/VDaGVIGN13BjHd2u8B61hArAGOnso7nBOouW3TQ==} + + make-dir@4.0.0: + resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} + engines: {node: '>=10'} + math-expression-evaluator@1.4.0: resolution: {integrity: sha512-4vRUvPyxdO8cWULGTh9dZWL2tZK6LDBvj+OGHBER7poH9Qdt7kXEoj20wiz4lQUbUXQZFjPbe5mVDo9nutizCw==} @@ -3739,6 +3779,8 @@ snapshots: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.28.5 + '@bcoe/v8-coverage@1.0.2': {} + '@csstools/color-helpers@5.1.0': {} '@csstools/css-calc@2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4)': @@ -4605,15 +4647,15 @@ snapshots: picocolors: 1.1.1 redent: 3.0.0 - '@testing-library/react@16.3.2(@testing-library/dom@10.4.1)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@testing-library/react@15.0.7(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@babel/runtime': 7.28.6 '@testing-library/dom': 10.4.1 + '@types/react-dom': 18.3.7(@types/react@18.3.28) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: '@types/react': 18.3.28 - '@types/react-dom': 18.3.7(@types/react@18.3.28) '@testing-library/user-event@14.6.1(@testing-library/dom@10.4.1)': dependencies: @@ -4968,6 +5010,20 @@ snapshots: transitivePeerDependencies: - '@swc/helpers' + '@vitest/coverage-v8@4.0.18(vitest@4.0.18(@types/node@25.3.3)(jsdom@26.1.0(bufferutil@4.1.0)(utf-8-validate@5.0.10))(msw@2.12.10(@types/node@25.3.3)(typescript@5.9.3)))': + dependencies: + '@bcoe/v8-coverage': 1.0.2 + '@vitest/utils': 4.0.18 + ast-v8-to-istanbul: 0.3.12 + istanbul-lib-coverage: 3.2.2 + istanbul-lib-report: 3.0.1 + istanbul-reports: 3.2.0 + magicast: 0.5.2 + obug: 2.1.1 + std-env: 3.10.0 + tinyrainbow: 3.0.3 + vitest: 4.0.18(@types/node@25.3.3)(jsdom@26.1.0(bufferutil@4.1.0)(utf-8-validate@5.0.10))(msw@2.12.10(@types/node@25.3.3)(typescript@5.9.3)) + '@vitest/expect@4.0.18': dependencies: '@standard-schema/spec': 1.1.0 @@ -5073,6 +5129,12 @@ snapshots: assertion-error@2.0.1: {} + ast-v8-to-istanbul@0.3.12: + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + estree-walker: 3.0.3 + js-tokens: 10.0.0 + asynckit@0.4.0: {} axios@1.13.6: @@ -5752,6 +5814,8 @@ snapshots: dependencies: whatwg-encoding: 3.1.1 + html-escaper@2.0.2: {} + http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.4 @@ -5840,6 +5904,19 @@ snapshots: isndarray@1.0.0: {} + istanbul-lib-coverage@3.2.2: {} + + istanbul-lib-report@3.0.1: + dependencies: + istanbul-lib-coverage: 3.2.2 + make-dir: 4.0.0 + supports-color: 7.2.0 + + istanbul-reports@3.2.0: + dependencies: + html-escaper: 2.0.2 + istanbul-lib-report: 3.0.1 + its-fine@1.2.5(@types/react@18.3.28)(react@18.3.1): dependencies: '@types/react-reconciler': 0.28.9(@types/react@18.3.28) @@ -5847,6 +5924,8 @@ snapshots: transitivePeerDependencies: - '@types/react' + js-tokens@10.0.0: {} + js-tokens@4.0.0: {} js-yaml@3.14.2: @@ -5953,6 +6032,16 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 + magicast@0.5.2: + dependencies: + '@babel/parser': 7.29.0 + '@babel/types': 7.29.0 + source-map-js: 1.2.1 + + make-dir@4.0.0: + dependencies: + semver: 7.7.4 + math-expression-evaluator@1.4.0: {} math-intrinsics@1.1.0: {} From 2f5002047f467b1992ed9c3a8d182c124f0dfa89 Mon Sep 17 00:00:00 2001 From: Douglas Winter Date: Fri, 27 Feb 2026 09:59:25 +0000 Subject: [PATCH 2/7] Configure coverage with base exclusions --- apps/visr/package.json | 3 ++- packages/vitest-conf/src/vitest.config.js | 12 ++++++++++++ turbo.json | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/visr/package.json b/apps/visr/package.json index 1465beab..312c36cb 100644 --- a/apps/visr/package.json +++ b/apps/visr/package.json @@ -10,7 +10,8 @@ "preview": "vite preview", "relay": "relay-compiler", "test": "vitest run", - "test:watch": "vitest" + "test:watch": "vitest", + "coverage": "vitest run --coverage" }, "dependencies": { "@atlas/blueapi": "workspace:*", diff --git a/packages/vitest-conf/src/vitest.config.js b/packages/vitest-conf/src/vitest.config.js index 1f0d8f4d..2860f130 100644 --- a/packages/vitest-conf/src/vitest.config.js +++ b/packages/vitest-conf/src/vitest.config.js @@ -13,5 +13,17 @@ export default defineConfig({ include: ["**/*.test.{ts,tsx}"], css: false, reporters: ["verbose"], + coverage: { + reporter: ["lcov", "json-summary", "text"], + include: ["src/**/*.{ts,tsx}"], + exclude: [ + "**/*.d.ts", + "**/main.tsx", + "**/index.ts", + "**/types.ts", + "**/mocks/**", + "**/*.graphql.ts", + ], + }, }, }); diff --git a/turbo.json b/turbo.json index 23009b3e..6d6f9e4d 100644 --- a/turbo.json +++ b/turbo.json @@ -15,6 +15,10 @@ }, "test": { "inputs": ["src/**", "vitest.config.*"] + }, + "coverage": { + "dependsOn": ["^build"], + "inputs": ["src/**", "vitest.config.ts"] } } } From ace3c432f7d049168229783fdb414b97a377d98b Mon Sep 17 00:00:00 2001 From: Douglas Winter Date: Fri, 27 Feb 2026 10:12:09 +0000 Subject: [PATCH 3/7] Add visr-level coverage exclusions; document --- apps/visr/vitest.config.ts | 15 +++++++++---- packages/vitest-conf/README.md | 41 +++++++++++++++++++++++++--------- 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/apps/visr/vitest.config.ts b/apps/visr/vitest.config.ts index 6dbadc23..b5ddb673 100644 --- a/apps/visr/vitest.config.ts +++ b/apps/visr/vitest.config.ts @@ -1,6 +1,13 @@ -import { defineConfig } from "vitest/config"; +import { defineConfig, mergeConfig } from "vitest/config"; import baseConfig from "@atlas/vitest-conf/vitest.config"; -export default defineConfig({ - ...baseConfig, -}); +export default mergeConfig( + baseConfig, + defineConfig({ + test: { + coverage: { + exclude: ["**/RelayEnvironment.ts"], + }, + }, + }), +); diff --git a/packages/vitest-conf/README.md b/packages/vitest-conf/README.md index faba088f..4b42279e 100644 --- a/packages/vitest-conf/README.md +++ b/packages/vitest-conf/README.md @@ -4,8 +4,6 @@ Shared Vitest configuration and test environment for the **Atlas** monorepo. This package centralises all testing setup — including Vitest configuration, jsdom environment, and Testing Library matchers — so that individual apps and packages can keep their own configs minimal and consistent. ---- - ## Features - Shared **Vitest** configuration via `vitest.config.ts` @@ -14,23 +12,19 @@ This package centralises all testing setup — including Vitest configuration, j - TypeScript definitions for `expect`, `describe`, etc. - Central place to update dependencies like `@testing-library/*` ---- - ## Usage -1. add `vitest` and `@atlas/vitest-conf` as dev dependencies in `apps/my-app/package.json`: +1. Add `vitest` and `@atlas/vitest-conf` as dev dependencies: -```json -"devDependencies": { - "vitest": "*", - "@atlas/vitest-conf": "workspace:*" -} +```bash +pnpm add -D -F @atlas/myapp @atlas/vitest-conf --workspace +pnpm add -D -F @atlas/myapp vitest ``` 2. Create a `vitest.config.ts` that simply reuses the shared base config: ```ts -// apps/my-app/vitest.config.ts +// apps/myapp/vitest.config.ts import { defineConfig } from "vitest/config"; import baseConfig from "@atlas/vitest-conf/vitest.config"; @@ -50,3 +44,28 @@ export default defineConfig({ ``` 4. Write some tests! Vitest will find tests that match `**/*.test.{ts,tsx}`. + +## Coverage + +Should _everything_ be covered by unit tests? `@atlas/vitest-conf` doesn't think so, and so makes some opinionated and generic exclusions for producing coverage reports. If your app needs to add to these, use `mergeConfig` in your app's `vitest.config.ts`. + +Example: + +```typescript +// apps/myapp/vitest.config.ts +import { defineConfig, mergeConfig } from "vitest/config"; +import baseConfig from "@atlas/vitest-conf/vitest.config"; + +export default mergeConfig( + baseConfig, + defineConfig({ + test: { + coverage: { + exclude: ["../RelayEnvironment.ts", "**/AppProviders.tsx"], + }, + }, + }), +); +``` + +If it is not a logic-bearing module, it may be OK for exclusion. Use your disgression. From 164ebe5777d5d86fd9357b3ec3d40f7e0d5dbea5 Mon Sep 17 00:00:00 2001 From: Douglas Winter Date: Fri, 27 Feb 2026 10:15:49 +0000 Subject: [PATCH 4/7] Add outputs to coverage turbo job for caching --- turbo.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/turbo.json b/turbo.json index 6d6f9e4d..05883d81 100644 --- a/turbo.json +++ b/turbo.json @@ -18,7 +18,8 @@ }, "coverage": { "dependsOn": ["^build"], - "inputs": ["src/**", "vitest.config.ts"] + "inputs": ["src/**", "vitest.config.ts"], + "outputs": ["coverage/**"] } } } From e604f52c1fcf66182ef15dcfe74484aa31d0771c Mon Sep 17 00:00:00 2001 From: Douglas Winter Date: Fri, 27 Feb 2026 15:27:47 +0000 Subject: [PATCH 5/7] Downgrade vitest and @vitest/coverage-v8 --- .gitignore | 2 ++ package.json | 4 ++-- pnpm-lock.yaml | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 80d1d3c9..f7ae3de7 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,5 @@ dist-ssr /helm/charts/ /apps/*/helm/charts/ *.tgz + +**/coverage/ \ No newline at end of file diff --git a/package.json b/package.json index fd934b33..f00c7686 100644 --- a/package.json +++ b/package.json @@ -17,14 +17,14 @@ "@eslint/js": "^9.36.0", "@types/react": "^18.3.1", "@types/react-dom": "^18.3.1", - "@vitest/coverage-v8": "^4.0.18", + "@vitest/coverage-v8": "^4.0.13", "eslint": "^9.36.0", "prettier": "^3.6.2", "sort-package-json": "^3.4.0", "turbo": "^2.5.6", "typescript": "^5.9.2", "typescript-eslint": "^8.44.1", - "vitest": "^4.0.18" + "vitest": "^4.0.13" }, "packageManager": "pnpm@10.17.1" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fd3cb06f..df18a844 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,7 +25,7 @@ importers: specifier: ^18.3.1 version: 18.3.7(@types/react@18.3.28) '@vitest/coverage-v8': - specifier: ^4.0.18 + specifier: ^4.0.13 version: 4.0.18(vitest@4.0.18(@types/node@25.3.3)(jsdom@26.1.0(bufferutil@4.1.0)(utf-8-validate@5.0.10))(msw@2.12.10(@types/node@25.3.3)(typescript@5.9.3))) eslint: specifier: ^9.36.0 @@ -46,7 +46,7 @@ importers: specifier: ^8.44.1 version: 8.56.1(eslint@9.39.3)(typescript@5.9.3) vitest: - specifier: ^4.0.18 + specifier: ^4.0.13 version: 4.0.18(@types/node@25.3.3)(jsdom@26.1.0(bufferutil@4.1.0)(utf-8-validate@5.0.10))(msw@2.12.10(@types/node@25.3.3)(typescript@5.9.3)) apps/i15-1: From 5fd0b3aac523a09333bddbe8e72ad111e39d53a8 Mon Sep 17 00:00:00 2001 From: Douglas Winter Date: Tue, 10 Mar 2026 15:32:30 +0000 Subject: [PATCH 6/7] Add coverage scripts to packages Also remove build dependency for the coverage turbo job, from an earlier architecture. --- packages/blueapi-query/package.json | 3 ++- packages/blueapi/package.json | 3 ++- turbo.json | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/blueapi-query/package.json b/packages/blueapi-query/package.json index 5229f13d..867c9f2f 100644 --- a/packages/blueapi-query/package.json +++ b/packages/blueapi-query/package.json @@ -7,7 +7,8 @@ ".": "./src/index.ts" }, "scripts": { - "test": "vitest run" + "test": "vitest run", + "coverage": "vitest run --coverage" }, "dependencies": { "@atlas/blueapi": "workspace:*" diff --git a/packages/blueapi/package.json b/packages/blueapi/package.json index ba75c036..0cb944e1 100644 --- a/packages/blueapi/package.json +++ b/packages/blueapi/package.json @@ -7,7 +7,8 @@ ".": "./src/index.ts" }, "scripts": { - "test": "vitest run" + "test": "vitest run", + "coverage": "vitest run --coverage" }, "dependencies": { "axios": "^1.13.5" diff --git a/turbo.json b/turbo.json index 05883d81..38083edd 100644 --- a/turbo.json +++ b/turbo.json @@ -17,7 +17,6 @@ "inputs": ["src/**", "vitest.config.*"] }, "coverage": { - "dependsOn": ["^build"], "inputs": ["src/**", "vitest.config.ts"], "outputs": ["coverage/**"] } From 04dedde9e7ecc77ce39018f063205e8891212614 Mon Sep 17 00:00:00 2001 From: Douglas Winter Date: Thu, 12 Mar 2026 09:06:03 +0000 Subject: [PATCH 7/7] Include examples of test and coverage scripts in vitest-conf README.md --- packages/vitest-conf/README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/vitest-conf/README.md b/packages/vitest-conf/README.md index 4b42279e..71b6e7e4 100644 --- a/packages/vitest-conf/README.md +++ b/packages/vitest-conf/README.md @@ -45,6 +45,17 @@ export default defineConfig({ 4. Write some tests! Vitest will find tests that match `**/*.test.{ts,tsx}`. +5. Add test and coverage Vitest scripts to your `package.json`. Turbo will run them if you call them 'test' and 'coverage': + +```json +{ + "scripts": { + "test": "vitest run", + "coverage": "vitest run --coverage" + } +} +``` + ## Coverage Should _everything_ be covered by unit tests? `@atlas/vitest-conf` doesn't think so, and so makes some opinionated and generic exclusions for producing coverage reports. If your app needs to add to these, use `mergeConfig` in your app's `vitest.config.ts`. @@ -68,4 +79,4 @@ export default mergeConfig( ); ``` -If it is not a logic-bearing module, it may be OK for exclusion. Use your disgression. +If it is not a logic-bearing module, it may be OK for exclusion. Use your discretion.