-
Notifications
You must be signed in to change notification settings - Fork 5.7k
/
Copy pathextensions.test.ts
36 lines (30 loc) · 1.26 KB
/
extensions.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { test as base } from "@playwright/test"
import * as path from "path"
import { getMaybeProxiedCodeServer } from "../utils/helpers"
import { describe, test, expect } from "./baseFixture"
function runTestExtensionTests() {
// This will only work if the test extension is loaded into code-server.
test("should have access to VSCODE_PROXY_URI", async ({ codeServerPage }) => {
const address = await getMaybeProxiedCodeServer(codeServerPage)
await codeServerPage.waitForTestExtensionLoaded()
await codeServerPage.executeCommandViaMenus("code-server: Get proxy URI")
// Remove end slash in address.
const normalizedAddress = address.replace(/\/+$/, "")
await codeServerPage.page.getByText(`Info: proxyUri: ${normalizedAddress}/proxy/{{port}}/`)
})
}
const flags = ["--disable-workspace-trust", "--extensions-dir", path.join(__dirname, "./extensions")]
describe("Extensions", flags, {}, () => {
runTestExtensionTests()
})
if (process.env.USE_PROXY !== "1") {
describe("Extensions with --cert", [...flags, "--cert"], {}, () => {
runTestExtensionTests()
})
} else {
base.describe("Extensions with --cert", () => {
base.skip("skipped because USE_PROXY is set", () => {
// Playwright will not show this without a function.
})
})
}