// For a detailed explanation regarding each configuration property, visit: // https://jestjs.io/docs/en/configuration.html const MODULE_NAME_MAPPING = { '@root/(.+)': '/$1', '@commons/(.+)': '/src/lib/$1', '@server/(.+)': '/src/server/$1', '@alias/logger': '/src/lib/service/logger', // -- doesn't work with unknown error -- 2019.06.19 Yuki Takei // debug: '/src/lib/service/logger/alias-for-debug', }; module.exports = { // Indicates whether each individual test should be reported during the run verbose: true, rootDir: '../', globalSetup: '/src/test/global-setup.js', globalTeardown: '/src/test/global-teardown.js', projects: [ { displayName: 'server', testEnvironment: 'node', rootDir: '.', setupFilesAfterEnv: ['/src/test/setup.js'], testMatch: ['/src/test/**/*.test.js'], // Automatically clear mock calls and instances between every test clearMocks: true, // A map from regular expressions to module names that allow to stub out resources with a single module moduleNameMapper: MODULE_NAME_MAPPING, }, // { // displayName: 'client', // rootDir: '.', // testMatch: ['/src/test/client/**/*.test.js'], // }, ], // Indicates whether the coverage information should be collected while executing the test // collectCoverage: false, // An array of glob patterns indicating a set of files for which coverage information should be collected collectCoverageFrom: [ 'src/client/**/*.js', 'src/lib/**/*.js', 'src/migrations/**/*.js', 'src/server/**/*.js', ], // The directory where Jest should output its coverage files coverageDirectory: 'coverage', };