Skip to content

Commit a942914

Browse files
rekmarksclaude
andauthored
feat: Add Turborepo caching for test:dev and fix streams dev tests (#757)
Running all of the unit tests is sloooow. By using `turbo`, like we do for builds, it can be much faster. Since it kind of sucks to not get any output while waiting for tests to pass, also moves the "quiet" mode to its own script. This should be used with agents for possible context savings. ## Summary - Add `test:dev` and `test:dev:quiet` tasks to Turborepo for cached local testing - `test:dev` runs with full output for debugging - `test:dev:quiet` uses dot reporter and `--output-logs=errors-only` for token-efficient AI workflows - Add `passWithNoTests: true` to vitest configs for packages without tests - Fix @metamask/streams tests to pass in dev mode by removing unnecessary coupling between environment choice and endoify setup ## Details ### Turborepo Caching Both `test:dev` and `test:dev:quiet` tasks depend on `^build` and enable caching of per-package tests. Subsequent runs without code changes will hit the cache. **Test commands:** - `yarn test:dev` - Full turbo output with verbose test results - `yarn test:dev:quiet` - Only shows output from failing packages, uses dot reporter ### Streams Fix The streams vitest.config.ts was coupling two unrelated concerns: - **Environment**: jsdom (dev) vs browser/Playwright (test) - **Endoify**: mock (dev) vs real (test) The mock-endoify setup doesn't actually freeze objects, causing `Object.isFrozen()` assertions to fail in dev mode. By using real endoify.js and browser/Playwright in both modes, tests now pass consistently. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent a0a2494 commit a942914

32 files changed

Lines changed: 108 additions & 80 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"rebuild:native": "./scripts/rebuild-native.sh",
3232
"test": "yarn pretest && vitest run",
3333
"test:ci": "vitest run --coverage false",
34-
"test:dev": "yarn test --mode development --reporter dot",
34+
"test:dev": "turbo run test:dev",
35+
"test:dev:quiet": "turbo run test:dev:quiet --output-logs=errors-only",
3536
"test:e2e": "yarn workspaces foreach --all run test:e2e",
3637
"test:e2e:ci": "yarn workspaces foreach --all run test:e2e:ci",
3738
"test:e2e:local": "yarn workspaces foreach --all run test:e2e:local",

packages/brow-2-brow/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121
"lint:misc": "prettier --no-error-on-unmatched-pattern '**/*.json' '**/*.md' '**/*.html' '!**/CHANGELOG.old.md' '**/*.yml' '!.yarnrc.yml' '!merged-packages/**' --ignore-path ../../.gitignore --log-level error",
2222
"test": "vitest run --config vitest.config.ts",
2323
"test:clean": "yarn test --no-cache --coverage.clean",
24-
"test:dev": "yarn test --mode development --reporter dot",
24+
"test:dev": "yarn test --mode development",
2525
"test:verbose": "yarn test --reporter verbose",
2626
"test:watch": "vitest --config vitest.config.ts",
2727
"start": "npm run build:dev && esbuild src/index.js --serve --sourcemap --bundle --outdir=dist --servedir=dist --external:@types/web",
28-
"start:relay": "node dist/src/relay.mjs"
28+
"start:relay": "node dist/src/relay.mjs",
29+
"test:dev:quiet": "yarn test:dev --reporter dot"
2930
},
3031
"dependencies": {
3132
"@chainsafe/libp2p-noise": "^16.1.3",

packages/brow-2-brow/vitest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default defineConfig((args) => {
1919
test: {
2020
name: 'brow2brow',
2121
exclude: ['**/test/integration/**'],
22+
passWithNoTests: true,
2223
},
2324
}),
2425
);

packages/cli/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727
"publish:preview": "yarn npm publish --tag preview",
2828
"test": "vitest run --config vitest.config.ts",
2929
"test:clean": "yarn test --no-cache --coverage.clean",
30-
"test:dev": "yarn test --mode development --reporter dot",
30+
"test:dev": "yarn test --mode development",
3131
"test:verbose": "yarn test --reporter verbose",
3232
"test:watch": "vitest --config vitest.config.ts",
33-
"test:integration": "vitest run --config vitest.integration.config.ts"
33+
"test:integration": "vitest run --config vitest.integration.config.ts",
34+
"test:dev:quiet": "yarn test:dev --reporter dot"
3435
},
3536
"dependencies": {
3637
"@chainsafe/libp2p-noise": "^16.1.3",

packages/create-package/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@
4040
"publish:preview": "yarn npm publish --tag preview",
4141
"test": "vitest run --config vitest.config.ts",
4242
"test:clean": "yarn test --no-cache --coverage.clean",
43-
"test:dev": "yarn test --mode development --reporter dot",
43+
"test:dev": "yarn test --mode development",
4444
"test:verbose": "yarn test --reporter verbose",
45-
"test:watch": "vitest --config vitest.config.ts"
45+
"test:watch": "vitest --config vitest.config.ts",
46+
"test:dev:quiet": "yarn test:dev --reporter dot"
4647
},
4748
"devDependencies": {
4849
"@arethetypeswrong/cli": "^0.17.4",

packages/extension/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@
3333
"test": "vitest run --config vitest.config.ts",
3434
"test:build": "tsx ./test/build/build-tests.ts",
3535
"test:clean": "yarn test --no-cache --coverage.clean",
36-
"test:dev": "yarn test --mode development --reporter dot",
36+
"test:dev": "yarn test --mode development",
3737
"test:verbose": "yarn test --reporter verbose",
3838
"test:watch": "vitest --config vitest.config.ts",
3939
"test:e2e": "yarn playwright test",
4040
"test:e2e:ci": "./scripts/test-e2e-ci.sh",
4141
"test:e2e:ui": "playwright test --ui",
42-
"test:e2e:debug": "playwright test --debug"
42+
"test:e2e:debug": "playwright test --debug",
43+
"test:dev:quiet": "yarn test:dev --reporter dot"
4344
},
4445
"dependencies": {
4546
"@metamask/kernel-browser-runtime": "workspace:^",

packages/kernel-agents-repl/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@
4141
"publish:preview": "yarn npm publish --tag preview",
4242
"test": "vitest run --config vitest.config.ts",
4343
"test:clean": "yarn test --no-cache --coverage.clean",
44-
"test:dev": "yarn test --mode development --reporter dot",
44+
"test:dev": "yarn test --mode development",
4545
"test:verbose": "yarn test --reporter verbose",
46-
"test:watch": "vitest --config vitest.config.ts"
46+
"test:watch": "vitest --config vitest.config.ts",
47+
"test:dev:quiet": "yarn test:dev --reporter dot"
4748
},
4849
"devDependencies": {
4950
"@arethetypeswrong/cli": "^0.17.4",

packages/kernel-agents/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@
141141
"publish:preview": "yarn npm publish --tag preview",
142142
"test": "vitest run --config vitest.config.ts",
143143
"test:clean": "yarn test --no-cache --coverage.clean",
144-
"test:dev": "yarn test --mode development --reporter dot",
144+
"test:dev": "yarn test --mode development",
145145
"test:verbose": "yarn test --reporter verbose",
146-
"test:watch": "vitest --config vitest.config.ts"
146+
"test:watch": "vitest --config vitest.config.ts",
147+
"test:dev:quiet": "yarn test:dev --reporter dot"
147148
},
148149
"devDependencies": {
149150
"@arethetypeswrong/cli": "^0.17.4",

packages/kernel-browser-runtime/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@
5858
"test": "vitest run --config vitest.config.ts",
5959
"test:build": "tsx ./test/build-tests.ts",
6060
"test:clean": "yarn test --no-cache --coverage.clean",
61-
"test:dev": "yarn test --mode development --reporter dot",
61+
"test:dev": "yarn test --mode development",
6262
"test:verbose": "yarn test --reporter verbose",
63-
"test:watch": "vitest --config vitest.config.ts"
63+
"test:watch": "vitest --config vitest.config.ts",
64+
"test:dev:quiet": "yarn test:dev --reporter dot"
6465
},
6566
"dependencies": {
6667
"@endo/marshal": "^1.8.0",

packages/kernel-errors/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@
5151
"publish:preview": "yarn npm publish --tag preview",
5252
"test": "vitest run --config vitest.config.ts",
5353
"test:clean": "yarn test --no-cache --coverage.clean",
54-
"test:dev": "yarn test --mode development --reporter dot",
54+
"test:dev": "yarn test --mode development",
5555
"test:verbose": "yarn test --reporter verbose",
56-
"test:watch": "vitest --config vitest.config.ts"
56+
"test:watch": "vitest --config vitest.config.ts",
57+
"test:dev:quiet": "yarn test:dev --reporter dot"
5758
},
5859
"dependencies": {
5960
"@libp2p/interface": "2.11.0",

0 commit comments

Comments
 (0)