feat(theme-shared): implement jest

pull/1884/head
mehmet-erim 5 years ago
parent 80da964dc3
commit 844225dd85

@ -18,7 +18,9 @@
},
"test": {
"builder": "@angular-builders/jest:run",
"options": {}
"options": {
"coverage": true
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
@ -44,11 +46,9 @@
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular-builders/jest:run",
"options": {
"main": "packages/theme-shared/src/test.ts",
"tsConfig": "packages/theme-shared/tsconfig.spec.json",
"karmaConfig": "packages/theme-shared/karma.conf.js"
"coverage": true
}
},
"lint": {

@ -5,6 +5,6 @@ const jestConfig = require('../../jest.config');
module.exports = {
...jestConfig,
name: 'core',
testMatch: ['<rootDir>/packages/core/**/+(*.)+(spec|test).+(ts|js)?(x)'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths /*, { prefix: '<rootDir>/' } */),
'ts-jest': { allowSyntheticDefaultImports: true },
};

@ -0,0 +1,10 @@
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const { compilerOptions } = require('./tsconfig.spec');
const jestConfig = require('../../jest.config');
module.exports = {
...jestConfig,
name: 'theme-shared',
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths /*, { prefix: '<rootDir>/' } */),
'ts-jest': { allowSyntheticDefaultImports: true },
};

@ -1,9 +1,14 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": ["node", "jest"]
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"],
"paths": {
"@abp/ng.theme-shared/*": ["packages/theme-shared/src/lib/*"]
}
},
"files": [],
"include": ["**/*.spec.ts", "**/*.d.ts"]
}

Loading…
Cancel
Save