From 6685b3a4ff534d4f11c2bde9408d984482a766f3 Mon Sep 17 00:00:00 2001 From: Asher Date: Fri, 12 Feb 2021 13:41:59 -0600 Subject: [PATCH] Move wtfnode setup to global setup I think Jest provides separate console methods for each test so when the socket tests finish Jest complains that a test keeps trying to output. --- test/globalSetup.ts | 3 +++ test/socket.test.ts | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/globalSetup.ts b/test/globalSetup.ts index 8a9746884..a3cd485eb 100644 --- a/test/globalSetup.ts +++ b/test/globalSetup.ts @@ -3,6 +3,7 @@ // ensuring that we're logged in before we run any tests import { chromium } from "playwright" import { CODE_SERVER_ADDRESS, PASSWORD } from "./constants" +import * as wtfnode from "./wtfnode" module.exports = async () => { console.log("🚨 Running Global Setup for Jest Tests") @@ -11,6 +12,8 @@ module.exports = async () => { const context = await browser.newContext() const page = await context.newPage() + wtfnode.setup() + await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "domcontentloaded" }) // Type in password await page.fill(".password", PASSWORD) diff --git a/test/socket.test.ts b/test/socket.test.ts index aadf86b40..e614e94db 100644 --- a/test/socket.test.ts +++ b/test/socket.test.ts @@ -6,11 +6,8 @@ import * as tls from "tls" import { Emitter } from "../src/common/emitter" import { SocketProxyProvider } from "../src/node/socket" import { generateCertificate, tmpdir } from "../src/node/util" -import * as wtfnode from "./wtfnode" describe("SocketProxyProvider", () => { - wtfnode.setup() - const provider = new SocketProxyProvider() const onServerError = new Emitter<{ event: string; error: Error }>()