mirror of
https://github.com/saltbo/zpan.git
synced 2026-09-01 05:44:38 +08:00
4f9483bd1f
- Top-level config is now production (no more [env.production]) - Remove local-only D1 binding with fake database_id that broke Workers Builds - Rename [env.preview] to [env.staging] - Update vitest cloudflare config to use top-level instead of env.production Dashboard config: - Deploy command: npx wrangler deploy - Version command: npx wrangler versions upload --env staging Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
26 lines
723 B
TypeScript
26 lines
723 B
TypeScript
import path from 'node:path'
|
|
import { cloudflareTest, readD1Migrations } from '@cloudflare/vitest-pool-workers'
|
|
import { defineConfig } from 'vitest/config'
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
cloudflareTest(async () => {
|
|
const migrationsPath = path.join(__dirname, './migrations')
|
|
const migrations = await readD1Migrations(migrationsPath)
|
|
|
|
return {
|
|
wrangler: { configPath: './wrangler.toml' },
|
|
miniflare: {
|
|
bindings: { TEST_MIGRATIONS: migrations },
|
|
},
|
|
}
|
|
}),
|
|
],
|
|
test: {
|
|
globals: true,
|
|
testTimeout: 15000,
|
|
include: ['server/**/*.cf-test.ts', 'workers/**/*.cf-test.ts'],
|
|
setupFiles: ['./server/test/apply-migrations.ts'],
|
|
},
|
|
})
|