File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change
1
+ import * as cp from "child_process" ;
1
2
import * as path from "path" ;
2
3
3
- import { runTests } from "vscode-test" ;
4
+ import { downloadAndUnzipVSCode , resolveCliPathFromVSCodeExecutablePath , runTests } from "vscode-test" ;
4
5
5
6
async function main ( ) {
6
7
try {
@@ -15,7 +16,20 @@ async function main() {
15
16
// The path to the workspace file
16
17
const workspace = path . resolve ( "test-fixtures" , "test.code-workspace" ) ;
17
18
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 ] ;
19
33
20
34
// Download VS Code, unzip it and run the integration test
21
35
await runTests ( { extensionDevelopmentPath, extensionTestsPath, launchArgs } ) ;
Original file line number Diff line number Diff line change @@ -8,7 +8,9 @@ import { extensionId } from "../../extension";
8
8
9
9
suite ( "Extension Test Suite" , ( ) => {
10
10
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 ( ) ;
12
14
const ext = extensions . getExtension ( extensionId ) ;
13
15
await ext ?. activate ( ) ;
14
16
} ) ;
@@ -18,7 +20,6 @@ suite("Extension Test Suite", () => {
18
20
} ) ;
19
21
20
22
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" ) ;
23
24
} ) ;
24
25
} ) ;
You can’t perform that action at this time.
0 commit comments