70bf21e064
Deploy (to testing) and Test Playground Preview Worker / Deploy Playground Preview Worker (testing) (push) Has been skipped
Deploy Workers Shared Staging / Deploy Workers Shared Staging (push) Failing after 0s
Prerelease / build (push) Has been skipped
Handle Changesets / Handle Changesets (push) Has been cancelled
Semgrep OSS scan / semgrep-oss (push) Has been cancelled
26 lines
768 B
TypeScript
26 lines
768 B
TypeScript
import { resolve } from "node:path";
|
|
import { fetch } from "undici";
|
|
import { describe, it } from "vitest";
|
|
import { runWranglerDev } from "../../shared/src/run-wrangler-long-lived";
|
|
|
|
describe("nodejs als", () => {
|
|
it("should work with node:async_hooks without full nodejs compat", async ({
|
|
expect,
|
|
}) => {
|
|
const { ip, port, stop, getOutput } = await runWranglerDev(
|
|
resolve(__dirname, "../src"),
|
|
["--port=0", "--inspector-port=0"]
|
|
);
|
|
try {
|
|
// There should be no warning about async_hooks
|
|
expect(getOutput()).not.toContain("node:async_hooks");
|
|
|
|
const response = await fetch(`http://${ip}:${port}/`);
|
|
const body = await response.text();
|
|
expect(body).toMatchInlineSnapshot(`"Working [1,2,3]"`);
|
|
} finally {
|
|
await stop();
|
|
}
|
|
});
|
|
});
|