mirror of
https://github.com/danog/code-server.git
synced 2024-11-27 04:45:52 +01:00
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:
parent
ef7e7271b6
commit
6685b3a4ff
@ -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)
|
||||||
|
@ -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 }>()
|
||||||
|
Loading…
Reference in New Issue
Block a user