mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-10-11 07:06:19 +00:00
- removes the external unmaintained `module-alias` dependency -> reducing complexity and risk - introduces a small internal alias mechanism for `logger` and `node_helper` - preserves backward compatibility for existing 3rd‑party modules - should simplify a future ESM migration of MagicMirror I'm confident that it shouldn't cause any problems, but we could also consider including it in the release after next. What do you think? This PR is inspired by PR #2934 - so thanks to @thesebas! 🙇 😃
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
const aliasMapper = {
|
|
logger: "<rootDir>/js/logger.js"
|
|
};
|
|
|
|
const config = {
|
|
verbose: true,
|
|
testTimeout: 20000,
|
|
testSequencer: "<rootDir>/tests/utils/test_sequencer.js",
|
|
projects: [
|
|
{
|
|
displayName: "unit",
|
|
globalSetup: "<rootDir>/tests/unit/helpers/global-setup.js",
|
|
moduleNameMapper: aliasMapper,
|
|
testMatch: ["**/tests/unit/**/*.[jt]s?(x)"],
|
|
testPathIgnorePatterns: ["<rootDir>/tests/unit/mocks", "<rootDir>/tests/unit/helpers"]
|
|
},
|
|
{
|
|
displayName: "electron",
|
|
testMatch: ["**/tests/electron/**/*.[jt]s?(x)"],
|
|
moduleNameMapper: aliasMapper,
|
|
testPathIgnorePatterns: ["<rootDir>/tests/electron/helpers"]
|
|
},
|
|
{
|
|
displayName: "e2e",
|
|
testMatch: ["**/tests/e2e/**/*.[jt]s?(x)"],
|
|
modulePaths: ["<rootDir>/js/"],
|
|
moduleNameMapper: aliasMapper,
|
|
testPathIgnorePatterns: ["<rootDir>/tests/e2e/helpers", "<rootDir>/tests/e2e/mocks"]
|
|
}
|
|
],
|
|
collectCoverageFrom: [
|
|
"<rootDir>/clientonly/**/*.js",
|
|
"<rootDir>/js/**/*.js",
|
|
"<rootDir>/modules/default/**/*.js",
|
|
"<rootDir>/serveronly/**/*.js"
|
|
],
|
|
coverageReporters: ["lcov", "text"],
|
|
coverageProvider: "v8"
|
|
};
|
|
|
|
module.exports = config;
|