You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/CLAUDE.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -301,10 +301,35 @@ class TestTask extends Task<TestInput, TestOutput> {
301
301
302
302
```sh
303
303
bun scripts/test.ts [--all] [kinds...] [sections...] [runners...] [options]
304
+
bun scripts/test.ts --changed [base] # only packages affected since base (default origin/main)
304
305
```
305
306
306
307
When making code changes, run the tests on that section only, and pass vitest only. Otherwise tests are very slow. For example, if you are making changes to the McpServer, run `bun scripts/test.ts mcp vitest`.
307
308
309
+
Sections are **discovered**, never enumerated — every directory holding tests maps to a
310
+
section, and `--check-sections` fails if any test file is unreachable by section+kind
311
+
selection. Note that `packages/test/src/test/task-graph*/` belongs to section `graph`,
312
+
not `task-graph`; `task-graph` selects the package's own co-located `__tests__`.
313
+
314
+
`--changed` delegates package selection to Turbo (`turbo run test --filter=...[base]`),
315
+
so a change also runs the tests of everything that depends on it. Only workspaces with a
316
+
`test` script participate; tooling tests outside any workspace (`scripts/`) are not
317
+
covered by that mode — run them with `bun scripts/test.ts scripts`.
318
+
319
+
### Vitest projects
320
+
321
+
The root `vitest.config.ts` defines one **project** per workspace that holds tests, and
322
+
the project list is derived from the same discovery the runner uses rather than written
323
+
out by hand. `vitest run --project task-graph` runs just that package; each package's own
324
+
`test` script is `vitest run --config ../../vitest.config.ts --project <name>`, which is
325
+
what Turbo invokes.
326
+
327
+
Anything path-shaped in the shared project options must be **absolute** — project roots
328
+
differ, so a relative `setupFiles` or `typecheck.tsconfig` would resolve against each
329
+
package and silently fail to load. `testDiscovery.test.ts` reads the real config and
330
+
fails if any discovered test file falls outside every project root: such a file does not
331
+
error or warn, it simply stops running.
332
+
308
333
### Developing without building
309
334
310
335
`bun run use-source` (or `./scripts/bunsrc-workspace.ts source`) makes every package resolve to its source files instead of its built files, so you can develop without rebuilding. It does **not** touch `package.json`: `exports` keeps pointing at `./dist/*`, and the script writes tiny re-export stubs into each package's (gitignored) `dist` folder — `dist/node.js` becomes `export * from "../src/node.ts"`, `dist/node.d.ts` the declaration equivalent. Source mode therefore leaves `git status` clean and there is nothing to revert before committing.
Copy file name to clipboardExpand all lines: packages/ai/package.json
+11-4Lines changed: 11 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -15,21 +15,24 @@
15
15
"homepage": "https://workglow.dev",
16
16
"scripts": {
17
17
"watch": "concurrently -c 'auto' 'bun:watch-*'",
18
-
"watch-js": "concurrently -c 'auto' -n 'browser,node,worker,provider-utils' 'bun run watch-browser' 'bun run watch-node' 'bun run watch-worker' 'bun run watch-provider-utils'",
18
+
"watch-js": "concurrently -c 'auto' -n 'browser,node,worker,provider-utils,test' 'bun run watch-browser' 'bun run watch-node' 'bun run watch-worker' 'bun run watch-provider-utils' 'bun run watch-test'",
"build-package": "concurrently -c 'auto' -n 'browser,node,worker,provider-utils,types' 'bun run build-browser' 'bun run build-node' 'bun run build-worker' 'bun run build-provider-utils' 'bun run build-types'",
25
-
"build-js": "concurrently -m 12 --timings -c 'auto' -n 'browser,node,worker,provider-utils' 'bun run build-browser' 'bun run build-node' 'bun run build-worker' 'bun run build-provider-utils'",
24
+
"build-package": "concurrently -c 'auto' -n 'browser,node,worker,provider-utils,test,types' 'bun run build-browser' 'bun run build-node' 'bun run build-worker' 'bun run build-provider-utils' 'bun run build-test' 'bun run build-types'",
25
+
"build-js": "concurrently -m 12 --timings -c 'auto' -n 'browser,node,worker,provider-utils,test' 'bun run build-browser' 'bun run build-node' 'bun run build-worker' 'bun run build-provider-utils' 'bun run build-test'",
0 commit comments