Skip to content

Commit 5749eec

Browse files
authored
chore: vitest not throw error while using @nx/vite:test directly (#1855)
1 parent 0dce151 commit 5749eec

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

packages/runtime/project.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,15 @@
5959
}
6060
},
6161
"test": {
62-
"executor": "@nx/vite:test",
63-
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
62+
"executor": "nx:run-commands",
6463
"options": {
65-
"config": "packages/runtime/vitest.config.ts"
66-
},
67-
"configurations": {
68-
"ci": {
69-
"ci": true,
70-
"codeCoverage": true
71-
}
64+
"parallel": false,
65+
"commands": [
66+
{
67+
"command": "vitest run -c packages/runtime/vitest.config.ts",
68+
"forwardAllArgs": false
69+
}
70+
]
7271
}
7372
}
7473
},

packages/runtime/vitest.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineConfig } from 'vitest/config';
22
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
3-
3+
import path from 'path';
44
export default defineConfig({
55
define: {
66
__DEV__: true,
@@ -11,9 +11,9 @@ export default defineConfig({
1111
plugins: [nxViteTsPaths()],
1212
test: {
1313
environment: 'jsdom',
14-
include: ['__tests__/*.spec.ts'],
14+
include: [path.resolve(__dirname, '__tests__/*.spec.ts')],
1515
globals: true,
16-
setupFiles: ['./__tests__/setup.ts'],
16+
setupFiles: [path.resolve(__dirname, './__tests__/setup.ts')],
1717
testTimeout: 10000,
1818
},
1919
});

0 commit comments

Comments
 (0)