Files
rplace/vitest.config.js
tiennm99 5765055588 test: add DO storage + integration coverage via wrangler unstable_dev
Pure-function unit tests for chunk-storage (BLOB-grow, orphan-row read,
multi-chunk grouping) and cooldown-store (TTL math, INSERT cursor drain,
GC sampling, release/refund) cover the bugs Phase 1 fixed.

Integration suite boots a local Worker + real DO via wrangler
unstable_dev and asserts cookie issuance, cooldown isolation across
identities, Content-Length 411/413 guards, WS upgrade semantics, WS
broadcast frame shape with monotonic seq, ping/pong, per-identity WS
cap, and Origin allowlist. WS uses the ws package directly since
unstable_dev's fetch strips CF's webSocket Response field.

156 tests pass in ~3.3s; verified stable across 3 consecutive runs.
2026-05-11 16:17:35 +07:00

14 lines
390 B
JavaScript

import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
include: ['test/**/*.test.js'],
exclude: ['test/integration/**'],
// Integration tests boot a local Worker via `wrangler unstable_dev`; allow
// headroom over the default 5s for startup + multi-WS test paths.
testTimeout: 30_000,
hookTimeout: 30_000,
},
});