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" ;
12import * as path from "path" ;
23
3- import { runTests } from "vscode-test" ;
4+ import { downloadAndUnzipVSCode , resolveCliPathFromVSCodeExecutablePath , runTests } from "vscode-test" ;
45
56async 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 } ) ;
Original file line number Diff line number Diff line change @@ -8,7 +8,9 @@ import { extensionId } from "../../extension";
88
99suite ( "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} ) ;
You can’t perform that action at this time.
0 commit comments