Skip to content

Commit 7f11487

Browse files
authored
fix(examples): update vitest config paths for packages and apps in with-vitest (#10675)
### Description The current `--with-vitest` example's root vitest.config.ts has `*` in the paths which seems to be invalid as shown below: ``` The project root contains the "*" character (/workspace/tmp/my-turborepo/packages/*), which may not work when running Vite. Consider renaming the directory / file to remove the characters. The project root contains the "*" character (/workspace/tmp/my-turborepo/apps/*), which may not work when running Vite. Consider renaming the directory / file to remove the characters. DEV v3.2.4 /workspace/tmp/my-turborepo No test files found. You can change the file name pattern by pressing "p" 0 include: **/*.{test,spec}.?(c|m)[jt]s?(x) exclude: **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**, **/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.* 1 include: **/*.{test,spec}.?(c|m)[jt]s?(x) exclude: **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**, **/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.* ``` Removing `/*` sufix fixes this issue as show below: ``` › bun run test:projects:watch $ vitest --watch DEV v3.2.4 /workspace/tmp/my-turborepo ✓ 0 math/tests/math.test.ts (2 tests) 2ms ✓ 1 web/tests/math.test.ts (1 test) 1ms ✓ 1 docs/tests/math.test.ts (1 test) 1ms Test Files 3 passed (3) Tests 4 passed (4) Start at 07:11:36 Duration 515ms (transform 43ms, setup 0ms, collect 31ms, tests 4ms, environment 626ms, prepare 139ms) ``` This is related to #10659 (comment) ### Testing Instructions Just run: `bun run test:projects:watch`
1 parent be6f7ba commit 7f11487

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

examples/with-vitest/vitest.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ export default defineConfig({
66
test: {
77
projects: [
88
{
9-
root: "./packages/*",
9+
root: "./packages",
1010
test: {
1111
...sharedConfig.test,
1212
// Project-specific configuration for packages
1313
// ...
1414
},
1515
},
1616
{
17-
root: "./apps/*",
17+
root: "./apps",
1818
test: {
1919
...sharedConfig.test,
2020
// Project-specific configuration for apps

0 commit comments

Comments
 (0)