Change test from karma to jest and added tsconfig paths

This commit is contained in:
Daniel Rodriguez 2021-10-22 15:16:17 +02:00
parent 50cb05d191
commit 275bd37552
22 changed files with 3467 additions and 724 deletions

15
jest.config.js Normal file
View file

@ -0,0 +1,15 @@
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const { compilerOptions } = require('./tsconfig');
module.exports = {
preset: 'jest-preset-angular',
roots: ['<rootDir>/src/'],
testMatch: ['**/+(*.)+(spec).+(ts)'],
setupFilesAfterEnv: ['<rootDir>/src/test.ts'],
collectCoverage: true,
coverageReporters: ['html'],
coverageDirectory: 'coverage/my-app',
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths || {}, {
prefix: '<rootDir>/'
})
};