File tree Expand file tree Collapse file tree 5 files changed +31
-15
lines changed
Expand file tree Collapse file tree 5 files changed +31
-15
lines changed Original file line number Diff line number Diff line change 11const path = require ( 'path' ) ;
22
3+ // module.exports = {
4+ // preset: 'ts-jest',
5+ // testEnvironment: './vscode-environment.js',
6+ // modulePaths: ['<rootDir>'],
7+ // // Add other Jest configurations as needed
8+ // // testMatch: ['**/test/**/*.js', '**/?(*.)+(spec|test).js'], // Match JavaScript files
9+ // moduleNameMapper: {
10+ // // '^@/(.*)$': 'build/src/$1', // Adjust this based on your project structure
11+ // vscode: path.join(__dirname, 'vscode.js') // <----- most important line
12+ // },
13+ // };
14+
315module . exports = {
4- preset : 'ts-jest' ,
5- testEnvironment : './vscode-environment.js' ,
6- modulePaths : [ '<rootDir>' ] ,
7- // Add other Jest configurations as needed
8- // testMatch: ['**/test/**/*.js', '**/?(*.)+(spec|test).js'], // Match JavaScript files
16+ preset : "ts-jest" ,
17+ testEnvironment : "node" ,
18+ preset : "ts-jest/presets/default-esm" , // or other ESM presets
19+ globals : {
20+ "ts-jest" : {
21+ useESM : true ,
22+ } ,
23+ } ,
924 moduleNameMapper : {
10- // '^@/(.*)$': 'build/src/$1', // Adjust this based on your project structure
25+ // '^@/(.*)$': 'build/src/$1',
1126 vscode : path . join ( __dirname , 'vscode.js' ) // <----- most important line
1227 } ,
13- } ;
28+ testMatch : [ '**/test/**/*.js' , '**/?(*.)+(spec|test).js' ]
29+ } ;
Original file line number Diff line number Diff line change 7070 "scripts" : {
7171 "lint" : " eslint ." ,
7272 "pretest" : " npm run lint" ,
73- "test" : " node build/src/test/runTest.js" ,
73+ "test" : " node ./ build/src/test/runTest.js" ,
7474 "dev" : " webpack --watch" ,
7575 "webpack" : " webpack"
7676 },
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ async function main() {
1919
2020 // Download VS Code, unzip it and run the integration test
2121 await runTests ( {
22- version : ' 1.85.1' ,
22+ version : " 1.85.1" ,
2323 extensionDevelopmentPath,
2424 extensionTestsPath
2525 } ) ;
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ import * as vscode from 'vscode'
66// we can either use test() or it() -- matter of style for team/project convention
77
88describe ( 'Extension Test Suite' , ( ) => {
9- beforeEach ( ( ) => {
10- vscode . window . showInformationMessage ( 'Start all tests.' ) ;
11- } ) ;
9+ // beforeEach(() => {
10+ // vscode.window.showInformationMessage('Start all tests.');
11+ // });
1212
1313 it ( 'Sample test' , ( ) => {
1414 expect ( [ 1 , 2 , 3 ] . indexOf ( 5 ) ) . toBe ( - 1 ) ;
Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ import * as vscode from 'vscode'
99// const myExtension = require('../extension');
1010
1111describe ( 'Parser Test Suite' , ( ) => {
12- beforeEach ( ( ) => {
13- vscode . window . showInformationMessage ( 'Start all tests.' ) ;
14- } ) ;
12+ // beforeEach(() => {
13+ // vscode.window.showInformationMessage('Start all tests.');
14+ // });
1515
1616 let parser , tree , file ;
1717
You can’t perform that action at this time.
0 commit comments