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.
This commit is contained in:
Asher 2021-02-12 13:41:59 -06:00 committed by Joe Previte
parent ef7e7271b6
commit 6685b3a4ff
No known key found for this signature in database
GPG Key ID: 2C91590C6B742C24
2 changed files with 3 additions and 3 deletions

View File

@ -3,6 +3,7 @@
// ensuring that we're logged in before we run any tests // ensuring that we're logged in before we run any tests
import { chromium } from "playwright" import { chromium } from "playwright"
import { CODE_SERVER_ADDRESS, PASSWORD } from "./constants" import { CODE_SERVER_ADDRESS, PASSWORD } from "./constants"
import * as wtfnode from "./wtfnode"
module.exports = async () => { module.exports = async () => {
console.log("🚨 Running Global Setup for Jest Tests") console.log("🚨 Running Global Setup for Jest Tests")
@ -11,6 +12,8 @@ module.exports = async () => {
const context = await browser.newContext() const context = await browser.newContext()
const page = await context.newPage() const page = await context.newPage()
wtfnode.setup()
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "domcontentloaded" }) await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "domcontentloaded" })
// Type in password // Type in password
await page.fill(".password", PASSWORD) await page.fill(".password", PASSWORD)

View File

@ -6,11 +6,8 @@ import * as tls from "tls"
import { Emitter } from "../src/common/emitter" import { Emitter } from "../src/common/emitter"
import { SocketProxyProvider } from "../src/node/socket" import { SocketProxyProvider } from "../src/node/socket"
import { generateCertificate, tmpdir } from "../src/node/util" import { generateCertificate, tmpdir } from "../src/node/util"
import * as wtfnode from "./wtfnode"
describe("SocketProxyProvider", () => { describe("SocketProxyProvider", () => {
wtfnode.setup()
const provider = new SocketProxyProvider() const provider = new SocketProxyProvider()
const onServerError = new Emitter<{ event: string; error: Error }>() const onServerError = new Emitter<{ event: string; error: Error }>()