Cleanup jest config (#2959)

Some small cleanups with regards to jest
- call jest directly (nyc is integrated in jest these days)
- move jest config into seperate file so we dont clutter up the
package.json
- remove empty test file for newsletter-unit-tests
- update dependencies that touch jest
- try out v8 as coverageProvider

Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
Veeck
2022-10-28 20:57:08 +02:00
committed by GitHub
parent c191ff0032
commit f79d3f007d
7 changed files with 694 additions and 1649 deletions

View File

@@ -13,7 +13,7 @@
"install-fonts": "echo \"Installing fonts ...\n\" && cd fonts && npm install --loglevel=error --no-audit --no-fund --no-update-notifier",
"postinstall": "npm run install-vendor && npm run install-fonts && echo \"MagicMirror² installation finished successfully! \n\"",
"test": "NODE_ENV=test jest -i --forceExit",
"test:coverage": "NODE_ENV=test nyc --reporter=lcov --reporter=text jest -i --forceExit",
"test:coverage": "NODE_ENV=test jest --coverage -i --forceExit",
"test:electron": "NODE_ENV=test jest --selectProjects electron -i --forceExit",
"test:e2e": "NODE_ENV=test jest --selectProjects e2e -i --forceExit",
"test:unit": "NODE_ENV=test jest --selectProjects unit -i --forceExit",
@@ -50,16 +50,15 @@
"homepage": "https://magicmirror.builders",
"devDependencies": {
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^27.1.1",
"eslint-plugin-jest": "^27.1.3",
"eslint-plugin-jsdoc": "^39.3.6",
"eslint-plugin-prettier": "^4.2.1",
"express-basic-auth": "^1.2.1",
"husky": "^8.0.1",
"jest": "^29.1.2",
"jest": "^29.2.2",
"jsdom": "^20.0.1",
"lodash": "^4.17.21",
"nyc": "^15.1.0",
"playwright": "^1.26.1",
"playwright": "^1.27.1",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3",
"sinon": "^14.0.1",
@@ -96,49 +95,5 @@
},
"engines": {
"node": ">=14"
},
"jest": {
"verbose": true,
"testTimeout": 20000,
"testSequencer": "<rootDir>/tests/configs/test_sequencer.js",
"projects": [
{
"displayName": "unit",
"moduleNameMapper": {
"logger": "<rootDir>/js/logger.js"
},
"testMatch": [
"**/tests/unit/**/*.[jt]s?(x)"
],
"testPathIgnorePatterns": [
"<rootDir>/tests/unit/mocks"
]
},
{
"displayName": "electron",
"testMatch": [
"**/tests/electron/**/*.[jt]s?(x)"
],
"testPathIgnorePatterns": [
"<rootDir>/tests/electron/helpers/"
]
},
{
"displayName": "e2e",
"setupFilesAfterEnv": [
"<rootDir>/tests/e2e/helpers/mock-console.js"
],
"testMatch": [
"**/tests/e2e/**/*.[jt]s?(x)"
],
"modulePaths": [
"<rootDir>/js/"
],
"testPathIgnorePatterns": [
"<rootDir>/tests/e2e/helpers/",
"<rootDir>/tests/e2e/mocks"
]
}
]
}
}