Skip to content

Commit e61f1ff

Browse files
committed
test: switch example app test config files to ts
1 parent 1264935 commit e61f1ff

File tree

75 files changed

+506
-525
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+506
-525
lines changed

examples/example-app-monorepo/apps/app1/jest-esm-isolated.config.mjs

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { JestConfigWithTsJest } from 'ts-jest';
2+
3+
import jestCfg from './jest-esm.config';
4+
5+
export default {
6+
...jestCfg,
7+
transform: {
8+
'^.+\\.(ts|js|html|svg)$': [
9+
'jest-preset-angular',
10+
{
11+
tsconfig: '<rootDir>/tsconfig-esm.spec.json',
12+
stringifyContentPathRegex: '\\.(html|svg)$',
13+
isolatedModules: true,
14+
useESM: true,
15+
},
16+
],
17+
},
18+
} satisfies JestConfigWithTsJest;

examples/example-app-monorepo/apps/app1/jest-esm.config.mjs

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import ngPreset from 'jest-preset-angular/presets';
2+
import { pathsToModuleNameMapper, type JestConfigWithTsJest } from 'ts-jest';
3+
4+
import tsconfig from './tsconfig.json';
5+
6+
export default {
7+
...ngPreset.defaultsESM,
8+
displayName: 'app1',
9+
moduleNameMapper: {
10+
...pathsToModuleNameMapper(tsconfig.compilerOptions.paths, { prefix: '<rootDir>' }),
11+
tslib: 'tslib/tslib.es6.js',
12+
rxjs: '<rootDir>/../../node_modules/rxjs/dist/bundles/rxjs.umd.js',
13+
},
14+
setupFilesAfterEnv: ['<rootDir>/setup-jest-esm.ts'],
15+
transform: {
16+
'^.+\\.(ts|js|html|svg)$': [
17+
'jest-preset-angular',
18+
{
19+
tsconfig: '<rootDir>/tsconfig-esm.spec.json',
20+
stringifyContentPathRegex: '\\.(html|svg)$',
21+
useESM: true,
22+
},
23+
],
24+
},
25+
} satisfies JestConfigWithTsJest;

examples/example-app-monorepo/apps/app1/jest-isolated.config.js

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import presets from 'jest-preset-angular/presets';
2+
import type { JestConfigWithTsJest } from 'ts-jest';
3+
4+
import jestCfg from './jest.config';
5+
6+
export default {
7+
...jestCfg,
8+
transform: {
9+
'^.+\\.(ts|js|mjs|html|svg)$': [
10+
'jest-preset-angular',
11+
{
12+
...presets.defaultTransformerOptions,
13+
isolatedModules: true,
14+
},
15+
],
16+
},
17+
} satisfies JestConfigWithTsJest;

examples/example-app-monorepo/apps/app1/jest.config.js

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { pathsToModuleNameMapper, type JestConfigWithTsJest } from 'ts-jest';
2+
3+
import { compilerOptions } from './tsconfig.json';
4+
5+
export default {
6+
displayName: 'app1',
7+
preset: 'jest-preset-angular',
8+
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
9+
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>' }),
10+
} satisfies JestConfigWithTsJest;

examples/example-app-monorepo/apps/app1/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig-base.json",
2+
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"baseUrl": "./",
55
"paths": {

examples/example-app-monorepo/jest-esm-isolated.config.mjs

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)