@@ -3,48 +3,54 @@ import * as fs from 'fs';
33import * as path from 'path' ;
44import { fileURLToPath } from 'url' ;
55
6+
67const dirname = fileURLToPath ( new URL ( '.' , import . meta. url ) ) ;
78const integrationTestDir = path . join ( dirname , 'out/test/integration' ) ;
89const workspaceBaseDir = path . join ( dirname , 'test-workspaces' ) ;
910
1011const vsCodeVersion = process . env . VSCODE_TEST_VERSION ?? 'stable' ;
1112const vsCodePlatform = process . env . VSCODE_TEST_PLATFORM ?? 'desktop' ;
1213
13- let createCommonOptions = ( label ) => {
14- if ( process . env . GITHUB_ACTIONS ) {
15- return {
16- platform : vsCodePlatform ,
17- version : vsCodeVersion ,
18- env : {
19- MOCHA_COLORS : 'true' ,
20- MOCHA_VSCODE_TEST : 'true'
21- } ,
22- mocha : {
23- ui : 'bdd' ,
14+ let extensionDevelopmentPath = '' ;
2415
25- reporter : path . join ( dirname , '.vscode-ci-test-reporter.js' ) ,
26- reporterOption : {
27- jsonReporterOption : {
28- output : path . join ( dirname , 'test-results' , `${ label } .json` ) ,
29- } ,
30- } ,
31- timeout : 60_000 ,
32- } ,
33- } ;
34- } else {
35- return {
36- platform : vsCodePlatform ,
37- version : vsCodeVersion ,
38- env : {
39- MOCHA_VSCODE_TEST : 'true'
40- } ,
41- mocha : {
42- ui : 'bdd' ,
43- timeout : 60_000 ,
16+ const testMode = process . env . TEST_MODE ?? 'normal' ;
17+
18+ if ( testMode === 'vsix' ) {
19+ const tempDir = process . env . TEST_TEMP ?? path . join ( dirname , 'tmp' )
20+ extensionDevelopmentPath = path . resolve ( path . join ( tempDir , 'vsix' , 'extension' ) ) ;
21+ }
22+
23+ function createCommonOptions ( label ) {
24+ /**@type {import('@vscode/test-cli').TestConfiguration } */
25+ const options = {
26+ platform : vsCodePlatform ,
27+ version : vsCodeVersion ,
28+ env : {
29+ MOCHA_VSCODE_TEST : 'true' ,
30+ } ,
31+ mocha : {
32+ ui : 'bdd' ,
33+ timeout : 60_000 ,
34+ } ,
35+ } ;
36+
37+ if ( process . env . GITHUB_ACTIONS ) {
38+ options . mocha . reporter = path . join ( dirname , '.vscode-ci-test-reporter.js' ) ;
39+ options . mocha . reporterOption = {
40+ jsonReporterOption : {
41+ output : path . join ( dirname , 'test-results' , `${ testMode } -${ label } .json` ) ,
4442 } ,
4543 } ;
44+ options . env . MOCHA_COLORS = 'true' ;
45+ }
46+
47+ if ( extensionDevelopmentPath ) {
48+ options . extensionDevelopmentPath = extensionDevelopmentPath ;
4649 }
47- } ;
50+
51+
52+ return options ;
53+ }
4854
4955const config = [
5056 {
0 commit comments