mirror of
https://github.com/LukeHagar/crossws.git
synced 2025-12-06 04:19:26 +00:00
silent cf test
This commit is contained in:
@@ -138,7 +138,7 @@ class WebSocketInspector extends Agent {
|
||||
|
||||
export function wsTestsExec(
|
||||
cmd: string,
|
||||
opts: Parameters<typeof wsTests>[1],
|
||||
opts: Parameters<typeof wsTests>[1] & { silent?: boolean },
|
||||
tests = wsTests,
|
||||
) {
|
||||
let childProc: ExecaRes;
|
||||
@@ -156,9 +156,12 @@ export function wsTestsExec(
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
childProc.stderr!.on("data", (chunk) => {
|
||||
console.log(chunk.toString());
|
||||
});
|
||||
if (process.env.TEST_DEBUG || !opts.silent) {
|
||||
console.log("hooking stderr");
|
||||
childProc.stderr!.on("data", (chunk) => {
|
||||
console.log(chunk.toString());
|
||||
});
|
||||
}
|
||||
if (process.env.TEST_DEBUG) {
|
||||
childProc.stdout!.on("data", (chunk) => {
|
||||
console.log(chunk.toString());
|
||||
|
||||
@@ -4,6 +4,6 @@ import { wsTestsExec } from "../_utils";
|
||||
describe("cloudflare", () => {
|
||||
wsTestsExec(
|
||||
"wrangler dev -c ./wrangler.toml --inspector-port 0 --port $PORT",
|
||||
{ adapter: "cloudflare", pubsub: false },
|
||||
{ adapter: "cloudflare", pubsub: false, silent: true },
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user