Skip to content

Commit d2d5c96

Browse files
committed
test: ✅ fix vitest cache collisions
1 parent ea1fa67 commit d2d5c96

File tree

91 files changed

+275
-46
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+275
-46
lines changed

apps/101-meal-planner-solution/vite.config.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import analog from '@analogjs/vite-plugin-angular';
22
import { defineConfig, Plugin } from 'vite';
33
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
4+
import { sep } from 'node:path';
5+
import { join } from 'node:path/posix';
6+
7+
const projectName = __dirname.split(sep).pop() ?? 'whiskmate';
48

59
export default defineConfig({
610
root: __dirname,
7-
cacheDir: '../../node_modules/.vite/tests/whiskmate',
11+
cacheDir: join('../../node_modules/.vite/tests', projectName),
812
plugins: [applyAnalogWorkaround(analog({ jit: false })), nxViteTsPaths()],
913
});
1014

apps/101-meal-planner-solution/vitest.config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default mergeConfig(
2020
watch: false,
2121
pool: 'threads',
2222
isolate: false,
23+
maxWorkers: 1,
2324
projects: [
2425
{
2526
extends: true,

apps/101-meal-planner-starter/vite.config.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import analog from '@analogjs/vite-plugin-angular';
22
import { defineConfig, Plugin } from 'vite';
33
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
4+
import { sep } from 'node:path';
5+
import { join } from 'node:path/posix';
6+
7+
const projectName = __dirname.split(sep).pop() ?? 'whiskmate';
48

59
export default defineConfig({
610
root: __dirname,
7-
cacheDir: '../../node_modules/.vite/tests/whiskmate',
11+
cacheDir: join('../../node_modules/.vite/tests', projectName),
812
plugins: [applyAnalogWorkaround(analog({ jit: false })), nxViteTsPaths()],
913
});
1014

apps/102-meal-planner-reactive-solution/vite.config.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import analog from '@analogjs/vite-plugin-angular';
22
import { defineConfig, Plugin } from 'vite';
33
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
4+
import { sep } from 'node:path';
5+
import { join } from 'node:path/posix';
6+
7+
const projectName = __dirname.split(sep).pop() ?? 'whiskmate';
48

59
export default defineConfig({
610
root: __dirname,
7-
cacheDir: '../../node_modules/.vite/tests/whiskmate',
11+
cacheDir: join('../../node_modules/.vite/tests', projectName),
812
plugins: [applyAnalogWorkaround(analog({ jit: false })), nxViteTsPaths()],
913
});
1014

apps/102-meal-planner-reactive-solution/vitest.config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default mergeConfig(
2020
watch: false,
2121
pool: 'threads',
2222
isolate: false,
23+
maxWorkers: 1,
2324
projects: [
2425
{
2526
extends: true,

apps/102-meal-planner-reactive-starter/vite.config.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import analog from '@analogjs/vite-plugin-angular';
22
import { defineConfig, Plugin } from 'vite';
33
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
4+
import { sep } from 'node:path';
5+
import { join } from 'node:path/posix';
6+
7+
const projectName = __dirname.split(sep).pop() ?? 'whiskmate';
48

59
export default defineConfig({
610
root: __dirname,
7-
cacheDir: '../../node_modules/.vite/tests/whiskmate',
11+
cacheDir: join('../../node_modules/.vite/tests', projectName),
812
plugins: [applyAnalogWorkaround(analog({ jit: false })), nxViteTsPaths()],
913
});
1014

apps/102-meal-planner-reactive-starter/vitest.config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default mergeConfig(
2020
watch: false,
2121
pool: 'threads',
2222
isolate: false,
23+
maxWorkers: 1,
2324
projects: [
2425
{
2526
extends: true,

apps/201-meal-planner-indirect-output-solution/vite.config.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import analog from '@analogjs/vite-plugin-angular';
22
import { defineConfig, Plugin } from 'vite';
33
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
4+
import { sep } from 'node:path';
5+
import { join } from 'node:path/posix';
6+
7+
const projectName = __dirname.split(sep).pop() ?? 'whiskmate';
48

59
export default defineConfig({
610
root: __dirname,
7-
cacheDir: '../../node_modules/.vite/tests/whiskmate',
11+
cacheDir: join('../../node_modules/.vite/tests', projectName),
812
plugins: [applyAnalogWorkaround(analog({ jit: false })), nxViteTsPaths()],
913
});
1014

apps/201-meal-planner-indirect-output-solution/vitest.config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default mergeConfig(
2020
watch: false,
2121
pool: 'threads',
2222
isolate: false,
23+
maxWorkers: 1,
2324
projects: [
2425
{
2526
extends: true,

apps/201-meal-planner-indirect-output-starter/vite.config.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import analog from '@analogjs/vite-plugin-angular';
22
import { defineConfig, Plugin } from 'vite';
33
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
4+
import { sep } from 'node:path';
5+
import { join } from 'node:path/posix';
6+
7+
const projectName = __dirname.split(sep).pop() ?? 'whiskmate';
48

59
export default defineConfig({
610
root: __dirname,
7-
cacheDir: '../../node_modules/.vite/tests/whiskmate',
11+
cacheDir: join('../../node_modules/.vite/tests', projectName),
812
plugins: [applyAnalogWorkaround(analog({ jit: false })), nxViteTsPaths()],
913
});
1014

0 commit comments

Comments
 (0)