mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
refactoring
- move the jest configuration files to the root directory - remove squirrel installer startup check - increase coverage for protocol handler - update package.json as per the above
This commit is contained in:
parent
b4c559c3ee
commit
a28fd90b09
3
.gitignore
vendored
3
.gitignore
vendored
@ -32,4 +32,5 @@ installer/win/Symphony-x86-SetupFiles
|
||||
package-lock.json
|
||||
library
|
||||
*.log
|
||||
js/translation/*_missing.json
|
||||
js/translation/*_missing.json
|
||||
out
|
@ -81,8 +81,8 @@
|
||||
- [Jest framework](http://facebook.github.io/jest/) is used to run tests
|
||||
- Use `npm test` to run unit tests
|
||||
- Use `npm run spectron-test` to run UI tests
|
||||
- Code coverage reports are placed in [coverage](./coverage) directory
|
||||
- To check the test run report, see the [dist](./dist) directory
|
||||
- Code coverage reports are placed in [coverage](./out/coverage) directory
|
||||
- To check the test run report, see the [dist](./out) directory
|
||||
- See the [tests](./tests) directory to find all the unit tests
|
||||
- See the [spectron](./tests/spectron) directory to find all the unit tests
|
||||
|
||||
|
28
jest.spectron.config.json
Normal file
28
jest.spectron.config.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"testMatch": [
|
||||
"**/*.spectron.js"
|
||||
],
|
||||
"verbose": true,
|
||||
"collectCoverage": true,
|
||||
"coverageReporters": [
|
||||
"text",
|
||||
"html"
|
||||
],
|
||||
"coverageDirectory": "out/coverage",
|
||||
"collectCoverageFrom": [
|
||||
"js/**/*.js",
|
||||
"!**/node_modules/**",
|
||||
"!**/vendor/**"
|
||||
],
|
||||
"reporters": [
|
||||
"default",
|
||||
["./node_modules/jest-html-reporter", {
|
||||
"pageTitle": "Symphony Electron Test Result",
|
||||
"includeFailureMsg": true,
|
||||
"includeConsoleLog": true,
|
||||
"theme": "lightTheme",
|
||||
"sort": "status",
|
||||
"outputPath": "./out/Spectron Tests Report.html"
|
||||
}]
|
||||
]
|
||||
}
|
28
jest.unit.config.json
Normal file
28
jest.unit.config.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"testMatch": [
|
||||
"**/*.test.js"
|
||||
],
|
||||
"verbose": true,
|
||||
"collectCoverage": true,
|
||||
"coverageReporters": [
|
||||
"text",
|
||||
"html"
|
||||
],
|
||||
"coverageDirectory": "out/coverage",
|
||||
"collectCoverageFrom": [
|
||||
"js/**/*.js",
|
||||
"!**/node_modules/**",
|
||||
"!**/vendor/**"
|
||||
],
|
||||
"reporters": [
|
||||
"default",
|
||||
["./node_modules/jest-html-reporter", {
|
||||
"pageTitle": "Symphony Electron Test Result",
|
||||
"includeFailureMsg": true,
|
||||
"includeConsoleLog": true,
|
||||
"theme": "lightTheme",
|
||||
"sort": "status",
|
||||
"outputPath": "./out/Unit Tests Report.html"
|
||||
}]
|
||||
]
|
||||
}
|
@ -6,7 +6,6 @@ const app = electron.app;
|
||||
const crashReporter = electron.crashReporter;
|
||||
const nodeURL = require('url');
|
||||
const shellPath = require('shell-path');
|
||||
const squirrelStartup = require('electron-squirrel-startup');
|
||||
const urlParser = require('url');
|
||||
const nodePath = require('path');
|
||||
const compareSemVersions = require('./utils/compareSemVersions.js');
|
||||
@ -45,11 +44,6 @@ shellPath()
|
||||
// used to check if a url was opened when the app was already open
|
||||
let isAppAlreadyOpen = false;
|
||||
|
||||
// exit early for squirrel installer
|
||||
if (squirrelStartup) {
|
||||
return;
|
||||
}
|
||||
|
||||
require('./mainApiMgr.js');
|
||||
|
||||
// monitor memory of main process
|
||||
|
17
package.json
17
package.json
@ -12,8 +12,8 @@
|
||||
"browserify-preload": "browserify -o js/preload/_preloadMain.js -x electron --insert-global-vars=__filename,__dirname js/preload/preloadMain.js --exclude electron-spellchecker",
|
||||
"rebuild": "electron-rebuild -f",
|
||||
"dev": "npm run prebuild && cross-env ELECTRON_DEV=true electron .",
|
||||
"test": "npm run lint && npm rebuild --build-from-source && cross-env ELECTRON_QA=true jest --config tests/jest_unit.json --runInBand && npm run rebuild",
|
||||
"spectron-test": "npm run lint && npm rebuild --build-from-source robotjs && cross-env ELECTRON_QA=true jest --config tests/spectron/jest_spectron.json --runInBand --detectOpenHandles",
|
||||
"test": "npm run lint && npm rebuild --build-from-source && cross-env ELECTRON_QA=true jest --config jest.unit.config.json --runInBand && npm run rebuild",
|
||||
"spectron-test": "npm run lint && npm rebuild --build-from-source robotjs && cross-env ELECTRON_QA=true jest --config jest.spectron.config.json --runInBand --detectOpenHandles",
|
||||
"demo-win": "npm run prebuild && cross-env ELECTRON_DEV=true electron . --url=file:///demo/index.html",
|
||||
"demo-mac": "npm run prebuild && cross-env ELECTRON_DEV=true electron . --url=file://$(pwd)/demo/index.html",
|
||||
"unpacked-mac": "npm run prebuild && npm run test && build --mac --dir",
|
||||
@ -21,18 +21,6 @@
|
||||
"unpacked-win": "npm run prebuild && npm run test && build --win --x64 --dir",
|
||||
"unpacked-win-x86": "npm run prebuild && npm run test && build --win --ia32 --dir"
|
||||
},
|
||||
"jest": {
|
||||
"collectCoverage": true,
|
||||
"transformIgnorePatterns": []
|
||||
},
|
||||
"jest-html-reporter": {
|
||||
"pageTitle": "Symphony Electron Test Result",
|
||||
"includeFailureMsg": true,
|
||||
"includeConsoleLog": true,
|
||||
"theme": "lightTheme",
|
||||
"outputPath": "./dist/Jest Test Report.html",
|
||||
"sort": "status"
|
||||
},
|
||||
"build": {
|
||||
"asarUnpack": [
|
||||
"node_modules/@paulcbetts/cld/build/Release/cld.node"
|
||||
@ -120,7 +108,6 @@
|
||||
"electron-dl": "1.12.0",
|
||||
"electron-log": "2.2.15",
|
||||
"electron-spellchecker": "1.1.2",
|
||||
"electron-squirrel-startup": "1.0.0",
|
||||
"ffi": "git+https://github.com/keerthi16/node-ffi.git#v1.2.8",
|
||||
"filesize": "3.6.1",
|
||||
"keymirror": "0.1.1",
|
||||
|
@ -104,4 +104,15 @@ describe('protocol handler', function () {
|
||||
|
||||
});
|
||||
|
||||
it('should cache the protocol url if the protocol window is not defined yet', (done) => {
|
||||
protocolHandler.setProtocolWindow(null);
|
||||
const setSpy = jest.spyOn(protocolHandler, 'setProtocolUrl');
|
||||
protocolHandler.setProtocolUrl(url);
|
||||
|
||||
protocolHandler.checkProtocolAction();
|
||||
expect(setSpy).toHaveBeenCalled();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
});
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"testMatch": ["**/*.test.js"],
|
||||
"verbose": true,
|
||||
"testResultsProcessor": "../node_modules/jest-html-reporter"
|
||||
}
|
||||
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"verbose": true,
|
||||
"testMatch": [
|
||||
"**/*.spectron.js"
|
||||
],
|
||||
"testResultsProcessor": "../../node_modules/jest-html-reporter"
|
||||
}
|
Loading…
Reference in New Issue
Block a user