Skip to content

Commit 68fdd6e

Browse files
committed
trying to get Spectron running
1 parent 97208fc commit 68fdd6e

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

__tests__/componentReducer.test.ts

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import reducer from '../app/src/reducers/componentReducer';
2-
import { State, Action, Component, ChildElement } from '../app/src/interfaces/InterfacesNew';
2+
// import { State, Action, Component, ChildElement } from '../app/src/interfaces/InterfacesNew';
33

44
import initialState from '../app/src/context/initialState';
55

@@ -8,10 +8,24 @@ const Application = require('spectron').Application;
88
const baseDir = path.join(__dirname, '..');
99
const electronPath = path.join(baseDir, 'node_modules', '.bin', 'electron');
1010

11+
const appArg = path.join(baseDir, 'app', 'electron', 'main.js');
12+
//const appArg = path.join(baseDir, 'app', 'electron');
13+
console.log(electronPath);
14+
console.log(appArg);
15+
16+
//const electronPath = '../node_modules/.bin/electron';
17+
//const electronPath = require('electron');
18+
1119
const app = new Application({
1220
path: electronPath,
13-
args: ['../app/electron/main.js']
21+
args: [appArg],
22+
chromeDriverArgs: ['--no-proxy-server'],
23+
env: {
24+
'NO_PROXY': '127.0.0.1,localhost'
25+
}
1426
})
27+
28+
console.log(app);
1529
// const testComponent: Component = {
1630
// id: 2,
1731
// name: "Test",
@@ -22,10 +36,11 @@ const app = new Application({
2236
// }
2337

2438
describe('Testing componentReducer functionality', () => {
25-
let state: State = initialState;
39+
let state = initialState;
40+
2641

27-
beforeAll(() => {
28-
return app.start();
42+
beforeAll(async () => {
43+
return await app.start();
2944
})
3045

3146
afterAll(() => {

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"dist-linux": "npm run prod-build && electron-builder --linux",
3636
"dist-windows": "npm run prod-build && electron-builder --windows",
3737
"dist-all": "npm run prod-build && electron-builder --mac --linux --windows",
38-
"test": "cross-env NODE_ENV=test jest --verbose"
38+
"test": "cross-env NODE_ENV=test NO_PROXY='127.0.0.1,localhost' jest --verbose",
39+
"mocha-test": "mocha"
3940
},
4041
"build": {
4142
"productName": "ReacType",
@@ -91,13 +92,16 @@
9192
"ts-jest": {
9293
"diagnostics": false
9394
}
94-
}
95+
},
96+
"testTimeout": 50000
9597
},
9698
"bugs": {
9799
"url": "https://github.com/open-source-labs/ReacType/issues"
98100
},
99101
"homepage": "https://github.com/open-source-labs/ReacType#readme",
100102
"dependencies": {
103+
"@babel/cli": "^7.10.4",
104+
"@babel/register": "^7.10.4",
101105
"@material-ui/core": "^4.11.0",
102106
"@material-ui/icons": "^4.0.1",
103107
"@material-ui/styles": "^4.9.6",
@@ -208,6 +212,7 @@
208212
"identity-obj-proxy": "^3.0.0",
209213
"jest": "^25.2.6",
210214
"mini-css-extract-plugin": "^0.9.0",
215+
"mocha": "^8.0.1",
211216
"mongodb": "^3.5.9",
212217
"mongoose": "^5.9.22",
213218
"node-sass": "^4.13.1",

0 commit comments

Comments
 (0)