-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathvitest.config.ts
More file actions
41 lines (36 loc) · 986 Bytes
/
vitest.config.ts
File metadata and controls
41 lines (36 loc) · 986 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
30
31
32
33
34
35
36
37
38
39
40
41
import path from 'node:path'
import {
cloudflareTest,
readD1Migrations,
} from '@cloudflare/vitest-pool-workers'
import { defineConfig } from 'vitest/config'
import { counterFixture } from './test/fixtures/counter.fixture.ts'
export default defineConfig(async () => {
const migrationsPath = path.join(import.meta.dirname, 'database/drizzle')
const migrations = await readD1Migrations(migrationsPath)
return {
test: {
setupFiles: ['./test/setup.ts'],
include: ['test/**/*.test.ts'],
exclude: ['**/_/**'],
},
plugins: [
cloudflareTest({
wrangler: {
configPath: './wrangler.json',
},
main: './src/index.tsx',
miniflare: {
compatibilityFlags: ['service_binding_extra_handlers'],
bindings: {
NODE_ENV: 'test',
BUN_VERSION: '1.3.8',
TEST_MIGRATIONS: migrations,
WHITELISTED_ORIGINS: 'http://localhost',
TEST_COMPILER_RESPONSE: JSON.stringify(counterFixture.solcOutput),
},
},
}),
],
}
})