forked from vercel/hyper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
44 lines (33 loc) · 942 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Native
import path from 'path';
// Packages
import test from 'ava';
import {Application} from 'spectron';
let app;
test.before(async () => {
let pathToBinary;
switch (process.platform) {
case 'linux':
pathToBinary = path.join(__dirname, '../dist/linux-unpacked/hyper');
break;
case 'darwin':
pathToBinary = path.join(__dirname, '../dist/mac/Hyper.app/Contents/MacOS/Hyper');
break;
case 'win32':
pathToBinary = path.join(__dirname, '../dist/win-unpacked/Hyper.exe');
break;
default:
throw new Error('Path to the built binary needs to be defined for this platform in test/index.js');
}
app = new Application({
path: pathToBinary
});
await app.start();
});
test.after(async () => {
await app.stop();
});
test('see if dev tools are open', async t => {
await app.client.waitUntilWindowLoaded();
t.false(await app.browserWindow.isDevToolsOpened());
});