Skip to content

Commit 6685b3a

Browse files
code-asherjsjoeio
authored andcommitted
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.
1 parent ef7e727 commit 6685b3a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

test/globalSetup.ts

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// ensuring that we're logged in before we run any tests
44
import { chromium } from "playwright"
55
import { CODE_SERVER_ADDRESS, PASSWORD } from "./constants"
6+
import * as wtfnode from "./wtfnode"
67

78
module.exports = async () => {
89
console.log("🚨 Running Global Setup for Jest Tests")
@@ -11,6 +12,8 @@ module.exports = async () => {
1112
const context = await browser.newContext()
1213
const page = await context.newPage()
1314

15+
wtfnode.setup()
16+
1417
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "domcontentloaded" })
1518
// Type in password
1619
await page.fill(".password", PASSWORD)

test/socket.test.ts

-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ import * as tls from "tls"
66
import { Emitter } from "../src/common/emitter"
77
import { SocketProxyProvider } from "../src/node/socket"
88
import { generateCertificate, tmpdir } from "../src/node/util"
9-
import * as wtfnode from "./wtfnode"
109

1110
describe("SocketProxyProvider", () => {
12-
wtfnode.setup()
13-
1411
const provider = new SocketProxyProvider()
1512

1613
const onServerError = new Emitter<{ event: string; error: Error }>()

0 commit comments

Comments
 (0)