Files
core/vitest.config.ts
T
chrnx a4c9df9a74 test(edge): edgeHandler HTTP + WebSocket on real workerd via Miniflare
Boots the actual workerd engine locally (miniflare devDep, no CF account
needed) and round-trips HTTP (app.fetch) + WebSocket (WebSocketPair +
app.upgrade) through edgeHandler's real request path, mirroring the Deno/Bun
adapter tests' assertion shape.

workerd's nodejs_compat genuinely does not implement node:http/node:https
(confirmed in isolation against the real runtime; node:crypto, node:stream,
node:net, node:tls, node:events, node:util, node:buffer all load fine under
the same flags). The barrel statically imports them for the Node listen()
path even though edgeHandler never touches it, so the bundler stubs those
two modules at test-bundle time (inert createServer that throws if ever
called) purely to let the worker load — edgeHandler itself is untouched.
See project-docs/.superpowers/sdd/task-2-report.md for the full writeup and
the suggested core follow-up (lazy-defer those imports behind listen()).

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-09 23:34:19 -05:00

13 lines
427 B
TypeScript

import { defineConfig, configDefaults } from 'vitest/config';
export default defineConfig({
test: {
globals: false,
environment: 'node',
include: ['test/**/*.test.ts'],
// test/deno/** holds Deno.test files run separately via `npm run test:deno`;
// they use `npm:`/`jsr:` specifiers vitest can't resolve.
exclude: [...configDefaults.exclude, 'test/deno/**', 'test/bun/**', 'test/edge/**'],
},
});