mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 03:39:55 +00:00
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:
parent
c191ff0032
commit
f79d3f007d
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,7 +16,6 @@ vendor/node_modules/**/*
|
||||
jspm_modules
|
||||
.npm
|
||||
.node_repl_history
|
||||
.nyc_output/
|
||||
|
||||
# Visual Studio Code ignoramuses.
|
||||
.vscode/
|
||||
|
@ -1,4 +1,3 @@
|
||||
/config
|
||||
/coverage
|
||||
.nyc_output
|
||||
package-lock.json
|
||||
|
@ -22,7 +22,7 @@ Special thanks to: @rejas, @sdetweil
|
||||
|
||||
### Updated
|
||||
|
||||
- Cleaned up test directory
|
||||
- Cleaned up test directory (#2937) and jest config (#2959)
|
||||
- Wait for all modules to start before declaring the system ready (#2487)
|
||||
- Updated e2e tests (moved `done()` in helper functions) and use es6 syntax in all tests
|
||||
- Updated da translation
|
||||
|
32
jest.config.js
Normal file
32
jest.config.js
Normal file
@ -0,0 +1,32 @@
|
||||
module.exports = async () => {
|
||||
return {
|
||||
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"]
|
||||
}
|
||||
],
|
||||
collectCoverageFrom: ["./clientonly/**/*.js", "./js/**/*.js", "./modules/**/*.js", "./serveronly/**/*.js"],
|
||||
coverageReporters: ["lcov", "text"],
|
||||
coverageProvider: "v8"
|
||||
};
|
||||
};
|
2239
package-lock.json
generated
2239
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
53
package.json
53
package.json
@ -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"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +0,0 @@
|
||||
describe("Functions into modules/default/newsfeed/newsfeed.js", () => {
|
||||
// Fake for use by newsletter.js
|
||||
Module = {};
|
||||
Module.definitions = {};
|
||||
Module.register = (name, moduleDefinition) => {
|
||||
Module.definitions[name] = moduleDefinition;
|
||||
};
|
||||
|
||||
beforeAll(() => {
|
||||
// load newsfeed.js
|
||||
require("../../../modules/default/newsfeed/newsfeed.js");
|
||||
});
|
||||
|
||||
test.skip("skip", () => {});
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user