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>
This commit is contained in:
7 files changed
+1002
-4
No files matched your search
+1
-1
@@ -7,6 +7,6 @@ export default defineConfig({
|
||||
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/**'],
|
||||
exclude: [...configDefaults.exclude, 'test/deno/**', 'test/bun/**', 'test/edge/**'],
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user