Skip to content

Commit 409cece

Browse files
committed
Fix e2e tests
1 parent 9788dc2 commit 409cece

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

desktop/test/e2e/app.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ let window;
1010

1111
export async function start() {
1212

13+
resetConfigJson();
1314
electronApp = await electron.launch({ args: ['.', 'test'] });
1415
window = await electronApp.firstWindow();
1516
return waitForExist('router-outlet', 60000);
@@ -44,16 +45,14 @@ export async function resetApp() {
4445
}
4546

4647

47-
export async function resetConfigJson() {
48+
export function resetConfigJson() {
49+
50+
const config = {
51+
'dbs': ['test'],
52+
'username': 'Test-User'
53+
};
4854

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));
5756
}
5857

5958

@@ -192,3 +191,4 @@ function getGlobal(globalName: string): Promise<any> {
192191

193192
return window.evaluate(value => require('@electron/remote').getGlobal(value), globalName);
194193
}
194+

0 commit comments

Comments
 (0)