File tree 1 file changed +9
-9
lines changed
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ let window;
10
10
11
11
export async function start ( ) {
12
12
13
+ resetConfigJson ( ) ;
13
14
electronApp = await electron . launch ( { args : [ '.' , 'test' ] } ) ;
14
15
window = await electronApp . firstWindow ( ) ;
15
16
return waitForExist ( 'router-outlet' , 60000 ) ;
@@ -44,16 +45,14 @@ export async function resetApp() {
44
45
}
45
46
46
47
47
- export async function resetConfigJson ( ) {
48
+ export function resetConfigJson ( ) {
49
+
50
+ const config = {
51
+ 'dbs' : [ 'test' ] ,
52
+ 'username' : 'Test-User'
53
+ } ;
48
54
49
- const configPath = await getGlobal ( 'configPath' ) ;
50
-
51
- return new Promise ( resolve => {
52
- fs . writeFile ( configPath , '' , err => {
53
- if ( err ) console . error ( 'Failure while resetting config.json' , err ) ;
54
- resolve ( undefined ) ;
55
- } ) ;
56
- } ) ;
55
+ fs . writeFileSync ( 'test/config/config.test.json' , JSON . stringify ( config ) ) ;
57
56
}
58
57
59
58
@@ -192,3 +191,4 @@ function getGlobal(globalName: string): Promise<any> {
192
191
193
192
return window . evaluate ( value => require ( '@electron/remote' ) . getGlobal ( value ) , globalName ) ;
194
193
}
194
+
You can’t perform that action at this time.
0 commit comments