Skip to content

Commit b059cc4

Browse files
Merge branch 'main' into jsjoeio/5369
2 parents dcf4974 + 11b2ef9 commit b059cc4

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

test/integration/installExtension.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,11 @@ describe("--install-extension", () => {
2222
const statInfo = await stat(pathToExtFolder)
2323
expect(statInfo.isDirectory()).toBe(true)
2424
}, 20000)
25+
it("should use EXTENSIONS_GALLERY when set", async () => {
26+
const extName = `author.extension-1.0.0`
27+
const { stderr } = await runCodeServerCommand([...setupFlags, "--install-extension", extName], {
28+
EXTENSIONS_GALLERY: "{}",
29+
})
30+
expect(stderr).toMatch("No extension gallery service configured")
31+
})
2532
})

test/utils/runCodeServerCommand.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ import { promisify } from "util"
66
*
77
* A helper function for integration tests to run code-server commands.
88
*/
9-
export async function runCodeServerCommand(argv: string[]): Promise<{ stdout: string; stderr: string }> {
9+
export async function runCodeServerCommand(
10+
argv: string[],
11+
env?: NodeJS.ProcessEnv,
12+
): Promise<{ stdout: string; stderr: string }> {
1013
const CODE_SERVER_COMMAND = process.env.CODE_SERVER_PATH || path.resolve("../../release-standalone/bin/code-server")
11-
const { stdout, stderr } = await promisify(exec)(`${CODE_SERVER_COMMAND} ${argv.join(" ")}`)
14+
const { stdout, stderr } = await promisify(exec)(`${CODE_SERVER_COMMAND} ${argv.join(" ")}`, {
15+
env: { ...process.env, ...env },
16+
})
1217

1318
return { stdout, stderr }
1419
}

0 commit comments

Comments
 (0)