-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.mts
More file actions
29 lines (27 loc) · 788 Bytes
/
vitest.config.mts
File metadata and controls
29 lines (27 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import path from 'node:path';
import { defineWorkersProject, readD1Migrations } from '@cloudflare/vitest-pool-workers/config';
export default defineWorkersProject(async () => {
// Read all migrations in the `migrations` directory
const migrationsPath = path.join(__dirname, 'migrations');
const migrations = await readD1Migrations(migrationsPath);
return {
test: {
// setupFiles: ['./test/apply-migrations.ts'],
poolOptions: {
workers: {
singleWorker: true,
wrangler: {
configPath: './wrangler.toml',
environment: 'test',
},
miniflare: {
// Add a test-only binding for migrations, so we can apply them in a
// setup file
bindings: { TEST_MIGRATIONS: migrations },
},
},
},
},
timeout: 50000 * 5,
};
});