add jest options

This commit is contained in:
Karsten Hassel 2021-06-11 22:14:57 +02:00
parent 99e5edf2c5
commit 044935a164
4 changed files with 5 additions and 21 deletions

View File

@ -10,10 +10,10 @@
"install": "echo \"Installing vendor files ...\n\" && cd vendor && npm install --loglevel=error",
"install-fonts": "echo \"Installing fonts ...\n\" && cd fonts && npm install --loglevel=error",
"postinstall": "npm run install-fonts && echo \"MagicMirror installation finished successfully! \n\"",
"test": "NODE_ENV=test jest -i",
"test:coverage": "NODE_ENV=test nyc --reporter=lcov --reporter=text jest -i",
"test:e2e": "NODE_ENV=test jest --selectProjects e2e -i",
"test:unit": "NODE_ENV=test jest --selectProjects unit",
"test": "NODE_ENV=test jest -i --silent --forceExit",
"test:coverage": "NODE_ENV=test nyc --reporter=lcov --reporter=text jest -i --silent --forceExit",
"test:e2e": "NODE_ENV=test jest --selectProjects e2e -i --silent --forceExit",
"test:unit": "NODE_ENV=test jest --selectProjects unit --silent --forceExit",
"test:prettier": "prettier . --check",
"test:js": "eslint js/**/*.js modules/default/**/*.js clientonly/*.js serveronly/*.js translations/*.js vendor/*.js tests/**/*.js config/* --config .eslintrc.json --quiet",
"test:css": "stylelint css/main.css modules/default/**/*.css --config .stylelintrc.json",

View File

@ -16,7 +16,7 @@ exports.getElectronPath = function () {
return electronPath;
};
// Set timeout - if this is run within Travis, increase timeout
// Set timeout - if this is run as CI Job, increase timeout
exports.setupTimeout = function (test) {
if (process.env.CI) {
jest.setTimeout(30000);

View File

@ -13,14 +13,8 @@ beforeAll(function () {
module: {},
__dirname: path.dirname(filePath),
global: {},
console: {
log: function () {
/*console.log("console.log(", arguments, ")");*/
}
},
process: {
on: function () {
/*console.log("process.on called with: ", arguments);*/
},
env: {}
}

View File

@ -13,14 +13,8 @@ beforeAll(function () {
module: {},
__dirname: path.dirname(filePath),
global: {},
console: {
log: function () {
/*console.log("console.log(", arguments, ")");*/
}
},
process: {
on: function () {
/*console.log("process.on called with: ", arguments);*/
},
env: {}
}
@ -35,10 +29,6 @@ beforeAll(function () {
vm.runInNewContext(code, sandbox, fileName);
});
afterAll(function () {
//console.log(global);
});
describe("'global.root_path' set in js/app.js", function () {
const expectedSubPaths = ["modules", "serveronly", "js", "js/app.js", "js/main.js", "js/electron.js", "config"];