Skip to content

Commit 0a3b3c2

Browse files
update test mocks
1 parent 98e9047 commit 0a3b3c2

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

src/test.ts

+21-4
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,29 @@ const context = require.context('./', true, /\.spec\.ts$/);
2020
context.keys().map(context);
2121

2222
const nw = 'nw';
23-
global[nw] = {
23+
const nwMock = {
2424
process: {
2525
versions: {
26-
nw: '0.39.2',
27-
node: '12.3.1',
28-
chromium: '75.0.3770.90'
26+
nw: '0.40.2',
27+
'nw-flavor': 'sdk',
28+
node: '12.9.1',
29+
chromium: '76.0.3809.132'
30+
}
31+
},
32+
Shell: {
33+
openExternal () {
34+
return undefined;
35+
}
36+
},
37+
Window: {
38+
get () {
39+
return {
40+
showDevTools () {
41+
return undefined;
42+
}
43+
};
2944
}
3045
}
3146
};
47+
global[nw] = nwMock;
48+
window[nw] = nwMock;

0 commit comments

Comments
 (0)