feat: add script reporting more errors
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
e9bd88d245
commit
189b9081ca
52
curriculum/package-lock.json
generated
52
curriculum/package-lock.json
generated
@ -5050,6 +5050,58 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"cross-env": {
|
||||||
|
"version": "7.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz",
|
||||||
|
"integrity": "sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"cross-spawn": "^7.0.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"cross-spawn": {
|
||||||
|
"version": "7.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||||
|
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"path-key": "^3.1.0",
|
||||||
|
"shebang-command": "^2.0.0",
|
||||||
|
"which": "^2.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"path-key": {
|
||||||
|
"version": "3.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
|
||||||
|
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"shebang-command": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"shebang-regex": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"shebang-regex": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"which": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"isexe": "^2.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"cross-spawn": {
|
"cross-spawn": {
|
||||||
"version": "6.0.5",
|
"version": "6.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
|
||||||
|
@ -18,7 +18,9 @@
|
|||||||
"lint": "gulp lint",
|
"lint": "gulp lint",
|
||||||
"semantic-release": "semantic-release",
|
"semantic-release": "semantic-release",
|
||||||
"pretest": "cd ../client && npm run build:workers",
|
"pretest": "cd ../client && npm run build:workers",
|
||||||
"test": "mocha --delay --reporter progress --bail"
|
"pretest:full-output": "npm run pretest",
|
||||||
|
"test": "mocha --delay --reporter progress --bail",
|
||||||
|
"test:full-output": "cross-env FULL_OUTPUT=true mocha --delay --reporter progress"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"invariant": "^2.2.4"
|
"invariant": "^2.2.4"
|
||||||
@ -44,6 +46,7 @@
|
|||||||
"babel-preset-stage-3": "^6.24.1",
|
"babel-preset-stage-3": "^6.24.1",
|
||||||
"babel-standalone": "^6.26.0",
|
"babel-standalone": "^6.26.0",
|
||||||
"chai": "4.2.0",
|
"chai": "4.2.0",
|
||||||
|
"cross-env": "^7.0.2",
|
||||||
"fs-extra": "^6.0.1",
|
"fs-extra": "^6.0.1",
|
||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
"joi": "^13.3.0",
|
"joi": "^13.3.0",
|
||||||
|
@ -55,13 +55,21 @@ const { createPoly } = require('../../utils/polyvinyl');
|
|||||||
const testEvaluator = require('../../client/config/test-evaluator').filename;
|
const testEvaluator = require('../../client/config/test-evaluator').filename;
|
||||||
|
|
||||||
// rethrow unhandled rejections to make sure the tests exit with -1
|
// rethrow unhandled rejections to make sure the tests exit with -1
|
||||||
process.on('unhandledRejection', err => {
|
process.on('unhandledRejection', err => handleRejection(err));
|
||||||
cleanup();
|
|
||||||
|
const handleRejection = err => {
|
||||||
// setting the error code because node does not (yet) exit with a non-zero
|
// setting the error code because node does not (yet) exit with a non-zero
|
||||||
// code on unhandled exceptions.
|
// code on unhandled exceptions.
|
||||||
process.exitCode = 1;
|
process.exitCode = 1;
|
||||||
|
cleanup();
|
||||||
|
if (process.env.FULL_OUTPUT === 'true') {
|
||||||
|
// some errors *may* not be reported, since cleanup is triggered by the
|
||||||
|
// first error and that starts shutting down the browser and the server.
|
||||||
|
console.error(err);
|
||||||
|
} else {
|
||||||
throw err;
|
throw err;
|
||||||
});
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const dom = new jsdom.JSDOM('');
|
const dom = new jsdom.JSDOM('');
|
||||||
global.document = dom.window.document;
|
global.document = dom.window.document;
|
||||||
@ -97,13 +105,7 @@ let page;
|
|||||||
|
|
||||||
setup()
|
setup()
|
||||||
.then(runTests)
|
.then(runTests)
|
||||||
.catch(err => {
|
.catch(err => handleRejection(err));
|
||||||
cleanup();
|
|
||||||
// setting the error code because node does not (yet) exit with a non-zero
|
|
||||||
// code on unhandled exceptions.
|
|
||||||
process.exitCode = 1;
|
|
||||||
throw err;
|
|
||||||
});
|
|
||||||
|
|
||||||
async function setup() {
|
async function setup() {
|
||||||
if (process.env.npm_config_superblock && process.env.npm_config_block) {
|
if (process.env.npm_config_superblock && process.env.npm_config_block) {
|
||||||
|
Reference in New Issue
Block a user