Skip to content

Commit

Permalink
feat(testing): use jest-preset-angular by default (#9418)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Oct 10, 2024
1 parent 63e11ef commit e064549
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 1,213 deletions.
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const config: JestConfigWithTsJest = {
preset: 'jest-preset-angular',
testEnvironment: 'jsdom',
extensionsToTreatAsEsm: ['.ts'],
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
setupFilesAfterEnv: ['./node_modules/@taiga-ui/testing/setup-jest/index.ts'],
transform: {
'^.+\\.(ts|js|mjs|html|svg)$': [
'jest-preset-angular',
Expand Down
1,328 changes: 124 additions & 1,204 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
```ts
import 'jest-preset-angular/setup-jest';
import '@taiga-ui/testing/setup-jest';

// allows you to do runtime reflection on types
Expand Down
2 changes: 1 addition & 1 deletion projects/testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"devDependencies": {
"@types/jest": "29.5.13",
"jest": "29.7.0",
"jest-preset-angular": "14.2.4",
"ts-jest": "29.2.5"
},
"peerDependencies": {
"@taiga-ui/cdk": ">=4.10.0 <5",
"jest-preset-angular": ">=14.2.4",
"tslib": ">=2.7.0"
}
}
5 changes: 5 additions & 0 deletions projects/testing/setup-jest/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
/// <reference types="jest" />
import 'jest-preset-angular/setup-jest';

import {tuiSwitchNgDevMode} from '@taiga-ui/testing/mocks';

tuiSwitchNgDevMode(false);

const {TextEncoder: TextEncoderMock, TextDecoder: TextDecoderMock} = require('node:util');

Expand Down
6 changes: 0 additions & 6 deletions setup-jest.ts

This file was deleted.

0 comments on commit e064549

Please sign in to comment.