Skip to content

Commit b557ee6

Browse files
committed
added install extensions for tests
1 parent 71f6b31 commit b557ee6

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

src/test/runTest.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import * as cp from "child_process";
12
import * as path from "path";
23

3-
import { runTests } from "vscode-test";
4+
import { downloadAndUnzipVSCode, resolveCliPathFromVSCodeExecutablePath, runTests } from "vscode-test";
45

56
async function main() {
67
try {
@@ -15,7 +16,20 @@ async function main() {
1516
// The path to the workspace file
1617
const workspace = path.resolve("test-fixtures", "test.code-workspace");
1718

18-
const launchArgs = ["-n", "--disable-extensions", workspace];
19+
const vscodeExecutablePath = await downloadAndUnzipVSCode("stable");
20+
const cliPath = resolveCliPathFromVSCodeExecutablePath(vscodeExecutablePath);
21+
22+
const installExtension = (extId) =>
23+
cp.spawnSync(cliPath, ["--install-extension", extId], {
24+
encoding: "utf-8",
25+
stdio: "inherit",
26+
});
27+
28+
// Install dependent extensions
29+
installExtension("intersystems-community.servermanager");
30+
installExtension("intersystems.language-server");
31+
32+
const launchArgs = ["-n", workspace];
1933

2034
// Download VS Code, unzip it and run the integration test
2135
await runTests({ extensionDevelopmentPath, extensionTestsPath, launchArgs });

src/test/suite/extension.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import { extensionId } from "../../extension";
88

99
suite("Extension Test Suite", () => {
1010
suiteSetup(async function () {
11-
// make sure git is activated
11+
// make sure extension is activated
12+
const serverManager = extensions.getExtension("intersystems-community.servermanager");
13+
await serverManager?.activate();
1214
const ext = extensions.getExtension(extensionId);
1315
await ext?.activate();
1416
});
@@ -18,7 +20,6 @@ suite("Extension Test Suite", () => {
1820
});
1921

2022
test("Sample test", () => {
21-
assert.equal([1, 2, 3].indexOf(5), -1);
22-
assert.equal([1, 2, 3].indexOf(0), -1);
23+
assert.ok("All good");
2324
});
2425
});

0 commit comments

Comments
 (0)