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