@@ -8,31 +8,37 @@ import { mkdirSync, rmSync, writeFileSync } from 'fs';
88
99let commandInstance : TestingModule ;
1010
11- beforeEach ( async ( ) => {
12- commandInstance = await CommandTestFactory . createTestingCommand ( {
13- imports : [ CommandModule ] ,
14- } )
15- // .overrideProvider(LogService)
16- // .useValue({})
17- . compile ( ) ;
18- const fileService =
19- commandInstance . resolve < FileManagerService > ( FileManagerService ) ;
20-
21- // Attempt to create test folder
22- ( await fileService ) . writeConfigFile ( {
23- dataFolderPath : join ( __dirname , 'test_data' ) ,
24- } ) ;
25- } ) ;
11+ beforeEach (
12+ ( ) =>
13+ new Promise < void > ( async ( res ) => {
14+ commandInstance = await CommandTestFactory . createTestingCommand ( {
15+ imports : [ CommandModule ] ,
16+ } )
17+ // .overrideProvider(LogService)
18+ // .useValue({})
19+ . compile ( ) ;
20+ const fileService =
21+ await commandInstance . resolve < FileManagerService > ( FileManagerService ) ;
2622
27- afterEach ( async ( ) => {
28- // Attempt to clean test folder
29- try {
30- await rmSync ( join ( __dirname , 'test_data' ) , {
31- recursive : true ,
32- force : true ,
33- } ) ;
34- } catch ( e ) { }
35- } ) ;
23+ // Attempt to create test folder
24+ await fileService . writeConfigFile ( {
25+ dataFolderPath : join ( __dirname , 'test_data' ) ,
26+ } ) ;
27+ res ( ) ;
28+ } ) ,
29+ ) ;
30+
31+ afterEach (
32+ ( ) =>
33+ new Promise < void > ( async ( res ) => {
34+ // Attempt to clean test folder
35+ rmSync ( join ( __dirname , 'test_data' ) , {
36+ recursive : true ,
37+ force : true ,
38+ } ) ;
39+ res ( ) ;
40+ } ) ,
41+ ) ;
3642
3743describe ( 'models list returns array of models' , ( ) => {
3844 test ( 'empty model list' , async ( ) => {
0 commit comments