chore(tests): tests simplified

This commit is contained in:
Alexey Kasyanchuk 2018-01-31 20:34:50 +03:00
parent cb39438b26
commit d21e093ac7
3 changed files with 6 additions and 10 deletions

View File

@ -2,18 +2,18 @@ import electron from "electron";
import { Application } from "spectron"; import { Application } from "spectron";
const beforeEach = function() { const beforeEach = function() {
this.timeout(10000); this.timeout(15000);
this.app = new Application({ this.app = new Application({
path: electron, path: electron,
args: ["."], args: ["."],
startTimeout: 10000, startTimeout: 15000,
waitTimeout: 10000 waitTimeout: 15000
}); });
return this.app.start(); return this.app.start();
}; };
const afterEach = function() { const afterEach = function() {
this.timeout(10000); this.timeout(15000);
if (this.app && this.app.isRunning()) { if (this.app && this.app.isRunning()) {
return this.app.stop(); return this.app.stop();
} }

View File

@ -62,11 +62,8 @@
}, },
"scripts": { "scripts": {
"postinstall": "electron-builder install-app-deps", "postinstall": "electron-builder install-app-deps",
"preunit": "webpack --config=build/webpack.unit.config.js --env=test --display=none", "pretest": "webpack --config=build/webpack.app.config.js --env=test --display=none && webpack --config=build/webpack.e2e.config.js --env=test --display=none",
"unit": "electron-mocha temp/specs.js --renderer --require source-map-support/register", "test": "mocha temp/e2e.js --require @babel/core/lib --require source-map-support/register",
"pree2e": "webpack --config=build/webpack.app.config.js --env=test --display=none && webpack --config=build/webpack.e2e.config.js --env=test --display=none",
"e2e": "mocha temp/e2e.js --require source-map-support/register",
"test": "npm run unit && npm run e2e",
"start": "node build/start.js", "start": "node build/start.js",
"prebuild": "webpack --config=build/webpack.app.config.js --env=production", "prebuild": "webpack --config=build/webpack.app.config.js --env=production",
"build": "electron-builder" "build": "electron-builder"
@ -97,7 +94,6 @@
"css-loader": "^0.28.7", "css-loader": "^0.28.7",
"electron": "1.7.11", "electron": "1.7.11",
"electron-builder": "^19.43.3", "electron-builder": "^19.43.3",
"electron-mocha": "^5.0.0",
"friendly-errors-webpack-plugin": "^1.6.1", "friendly-errors-webpack-plugin": "^1.6.1",
"mocha": "^4.0.1", "mocha": "^4.0.1",
"source-map-support": "^0.5.0", "source-map-support": "^0.5.0",