Skip to content

Commit da2926d

Browse files
authored
core: use Jest for testing (#6)
1 parent ac75b70 commit da2926d

6 files changed

Lines changed: 17190 additions & 12723 deletions

File tree

angular.json

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,9 @@
7676
"extract-i18n": {
7777
"builder": "@angular-devkit/build-angular:extract-i18n"
7878
},
79-
"test": {
80-
"builder": "@angular-devkit/build-angular:web-test-runner",
81-
"options": {
82-
"polyfills": ["zone.js", "zone.js/testing"],
83-
"tsConfig": "tsconfig.spec.json",
84-
"inlineStyleLanguage": "scss",
85-
"assets": [
86-
{
87-
"glob": "**/*",
88-
"input": "public"
89-
},
90-
91-
],
92-
"styles": ["src/styles.scss"],
93-
"scripts": []
94-
}
95-
},
79+
// "test": {
80+
// "builder": "@angular-builders/jest:run"
81+
// },
9682
"storybook": {
9783
"builder": "@storybook/angular:start-storybook",
9884
"options": {

jest.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const { pathsToModuleNameMapper } = require('ts-jest');
2+
const { paths } = require('./tsconfig.json').compilerOptions;
3+
4+
/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
5+
module.exports = {
6+
preset: 'jest-preset-angular',
7+
moduleNameMapper: pathsToModuleNameMapper(paths, { prefix: '<rootDir>' }),
8+
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
9+
};

0 commit comments

Comments
 (0)