Skip to content

Commit 3775ab9

Browse files
code-asherjsjoeio
authored andcommitted
Gate wtfnode behind WTF_NODE env var
After thinking about it some more it's probably mostly only useful to see the output when the tests are hanging. Otherwise there's a lot of noise about Jest child processes and pipes.
1 parent 9639d93 commit 3775ab9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

test/e2e.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { chromium, Page, Browser } from "playwright"
2+
import { CODE_SERVER_ADDRESS } from "./constants"
23

34
let browser: Browser
45
let page: Page
@@ -17,7 +18,7 @@ afterEach(async () => {
1718
})
1819

1920
it("should see the login page", async () => {
20-
await page.goto(process.env)
21+
await page.goto(CODE_SERVER_ADDRESS)
2122
// It should send us to the login page
2223
expect(await page.title()).toBe("code-server login")
2324
})

test/globalSetup.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ import { CODE_SERVER_ADDRESS, PASSWORD } from "./constants"
66
import * as wtfnode from "./wtfnode"
77

88
module.exports = async () => {
9-
console.log("🚨 Running Global Setup for Jest Tests")
10-
console.log(" Please hang tight...")
9+
console.log("\n🚨 Running Global Setup for Jest Tests")
10+
console.log(" Please hang tight...")
1111
const browser = await chromium.launch()
1212
const context = await browser.newContext()
1313
const page = await context.newPage()
1414

15-
wtfnode.setup()
15+
if (process.env.WTF_NODE) {
16+
wtfnode.setup()
17+
}
1618

1719
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "domcontentloaded" })
1820
// Type in password

0 commit comments

Comments
 (0)