@@ -201,37 +201,23 @@ describe('app', () => {
201
201
` ) ;
202
202
} ) ;
203
203
204
- it ( 'should generate a modified vite config file to allow the poolOptions when vitest is the test runner' , async ( ) => {
204
+ it ( 'should generate a vitest config file to allow the poolOptions when vitest is the test runner' , async ( ) => {
205
205
await applicationGenerator ( tree , {
206
206
name : 'myWorkerApp' ,
207
207
directory : 'myWorkerApp' ,
208
208
projectNameAndRootFormat : 'as-provided' ,
209
209
} ) ;
210
- expect ( tree . read ( 'myWorkerApp/vite .config.ts' , 'utf-8' ) )
210
+ expect ( tree . read ( 'myWorkerApp/vitest .config.ts' , 'utf-8' ) )
211
211
. toMatchInlineSnapshot ( `
212
- "import { defineConfig } from 'vite';
213
-
214
- import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
215
-
216
- export default defineConfig({
217
- root: __dirname,
218
- cacheDir: '../node_modules/.vite/myWorkerApp',
219
-
220
- plugins: [nxViteTsPaths()],
221
-
222
- // Uncomment this if you are using workers.
223
- // worker: {
224
- // plugins: [ nxViteTsPaths() ],
225
- // },
212
+ "import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config';
226
213
214
+ export default defineWorkersConfig({
227
215
test: {
228
- watch: false,
229
- globals: true,
230
- cache: { dir: '../node_modules/.vitest/myWorkerApp' },
231
- environment: 'node',
232
- include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
233
- reporters: ['default'],
234
- coverage: { reportsDirectory: '../coverage/myWorkerApp', provider: 'v8' },
216
+ poolOptions: {
217
+ workers: {
218
+ wrangler: { configPath: './wrangler.toml' },
219
+ },
220
+ },
235
221
},
236
222
});
237
223
"
0 commit comments