File tree 4 files changed +249
-59
lines changed
4 files changed +249
-59
lines changed Original file line number Diff line number Diff line change 28
28
"test" : " cd .. && tsc && cd sample && tsc && node ./out/test/runTest.js"
29
29
},
30
30
"devDependencies" : {
31
- "@types/glob" : " ^7.1.3" ,
32
31
"@types/mocha" : " ^8.2.0" ,
33
32
"@types/node" : " ^18" ,
34
33
"@types/vscode" : " ^1.52.0" ,
35
- "glob" : " ^7.1.6 " ,
34
+ "glob" : " ^10.3.10 " ,
36
35
"mocha" : " ^8.2.1" ,
37
36
"typescript" : " ^4.1.3"
38
37
},
Original file line number Diff line number Diff line change 1
1
import * as path from 'path' ;
2
2
import * as Mocha from 'mocha' ;
3
- import * as glob from 'glob' ;
3
+ import { glob } from 'glob' ;
4
4
5
5
export function run ( testsRoot : string , cb : ( error : any , failures ?: number ) => void ) : void {
6
6
// Create the mocha test
7
7
const mocha = new Mocha ( {
8
- ui : 'tdd'
8
+ ui : 'tdd' ,
9
9
} ) ;
10
10
11
- glob ( '**/**.test.js' , { cwd : testsRoot } , ( err , files ) => {
12
- if ( err ) {
13
- return cb ( err ) ;
14
- }
15
-
16
- // Add files to the test suite
17
- files . forEach ( f => mocha . addFile ( path . resolve ( testsRoot , f ) ) ) ;
11
+ glob ( '**/**.test.js' , { cwd : testsRoot } )
12
+ . then ( ( files ) => {
13
+ // Add files to the test suite
14
+ files . forEach ( ( f ) => mocha . addFile ( path . resolve ( testsRoot , f ) ) ) ;
18
15
19
- try {
20
- // Run the mocha test
21
- mocha . run ( failures => {
22
- cb ( null , failures ) ;
23
- } ) ;
24
- } catch ( err ) {
25
- console . error ( err ) ;
26
- cb ( err ) ;
27
- }
28
- } ) ;
16
+ try {
17
+ // Run the mocha test
18
+ mocha . run ( ( failures ) => {
19
+ cb ( null , failures ) ;
20
+ } ) ;
21
+ } catch ( err ) {
22
+ console . error ( err ) ;
23
+ cb ( err ) ;
24
+ }
25
+ } )
26
+ . catch ( ( err ) => {
27
+ return cb ( err ) ;
28
+ } ) ;
29
29
}
Original file line number Diff line number Diff line change 1
1
import * as path from 'path' ;
2
2
import * as Mocha from 'mocha' ;
3
- import * as glob from 'glob' ;
3
+ import { glob } from 'glob' ;
4
4
5
5
export function run ( testsRoot : string , cb : ( error : any , failures ?: number ) => void ) : void {
6
6
// Create the mocha test
7
7
const mocha = new Mocha ( {
8
- ui : 'tdd'
8
+ ui : 'tdd' ,
9
9
} ) ;
10
10
11
- glob ( '**/**.test.js' , { cwd : testsRoot } , ( err , files ) => {
12
- if ( err ) {
13
- return cb ( err ) ;
14
- }
15
-
16
- // Add files to the test suite
17
- files . forEach ( f => mocha . addFile ( path . resolve ( testsRoot , f ) ) ) ;
11
+ glob ( '**/**.test.js' , { cwd : testsRoot } )
12
+ . then ( ( files ) => {
13
+ // Add files to the test suite
14
+ files . forEach ( ( f ) => mocha . addFile ( path . resolve ( testsRoot , f ) ) ) ;
18
15
19
- try {
20
- // Run the mocha test
21
- mocha . run ( failures => {
22
- cb ( null , failures ) ;
23
- } ) ;
24
- } catch ( err ) {
25
- cb ( err ) ;
26
- }
27
- } ) ;
16
+ try {
17
+ // Run the mocha test
18
+ mocha . run ( ( failures ) => {
19
+ cb ( null , failures ) ;
20
+ } ) ;
21
+ } catch ( err ) {
22
+ cb ( err ) ;
23
+ }
24
+ } )
25
+ . catch ( ( err ) => {
26
+ return cb ( err ) ;
27
+ } ) ;
28
28
}
You can’t perform that action at this time.
0 commit comments