Skip to content

Commit

Permalink
refactor: simplify jest config
Browse files Browse the repository at this point in the history
  • Loading branch information
maxokorokov committed Feb 27, 2025
1 parent 7f7e81c commit 127ff08
Showing 1 changed file with 6 additions and 25 deletions.
31 changes: 6 additions & 25 deletions packages/angular/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,16 @@
import { Config } from 'jest';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
globalThis.ngJest = {
skipNgcc: true,
};
import type { JestConfigWithTsJest } from 'ts-jest';
import ngPreset from 'jest-preset-angular/presets';

export default {
displayName: 'microfrontends-angular',
preset: 'jest-preset-angular',
...ngPreset.createCjsPreset({
tsconfig: '<rootDir>/lib/tsconfig.spec.json',
}),
roots: ['<rootDir>/lib/src'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],

// Angular setup
transform: {
'^.+\\.tsx?$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/lib/tsconfig.spec.json',
stringifyContentPathRegex: '\\.html$',
},
],
},
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],

// Coverage
collectCoverageFrom: ['lib/src/**/*.ts'],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov'],
} as Config;
} as JestConfigWithTsJest;

0 comments on commit 127ff08

Please sign in to comment.