-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: switch example app test config files to ts
- Loading branch information
Showing
75 changed files
with
506 additions
and
525 deletions.
There are no files selected for viewing
19 changes: 0 additions & 19 deletions
19
examples/example-app-monorepo/apps/app1/jest-esm-isolated.config.mjs
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
examples/example-app-monorepo/apps/app1/jest-esm-isolated.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
import jestCfg from './jest-esm.config'; | ||
|
||
export default { | ||
...jestCfg, | ||
transform: { | ||
'^.+\\.(ts|js|html|svg)$': [ | ||
'jest-preset-angular', | ||
{ | ||
tsconfig: '<rootDir>/tsconfig-esm.spec.json', | ||
stringifyContentPathRegex: '\\.(html|svg)$', | ||
isolatedModules: true, | ||
useESM: true, | ||
}, | ||
], | ||
}, | ||
} satisfies JestConfigWithTsJest; |
27 changes: 0 additions & 27 deletions
27
examples/example-app-monorepo/apps/app1/jest-esm.config.mjs
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
examples/example-app-monorepo/apps/app1/jest-esm.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import ngPreset from 'jest-preset-angular/presets'; | ||
import { pathsToModuleNameMapper, type JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
import tsconfig from './tsconfig.json'; | ||
|
||
export default { | ||
...ngPreset.defaultsESM, | ||
displayName: 'app1', | ||
moduleNameMapper: { | ||
...pathsToModuleNameMapper(tsconfig.compilerOptions.paths, { prefix: '<rootDir>' }), | ||
tslib: 'tslib/tslib.es6.js', | ||
rxjs: '<rootDir>/../../node_modules/rxjs/dist/bundles/rxjs.umd.js', | ||
}, | ||
setupFilesAfterEnv: ['<rootDir>/setup-jest-esm.ts'], | ||
transform: { | ||
'^.+\\.(ts|js|html|svg)$': [ | ||
'jest-preset-angular', | ||
{ | ||
tsconfig: '<rootDir>/tsconfig-esm.spec.json', | ||
stringifyContentPathRegex: '\\.(html|svg)$', | ||
useESM: true, | ||
}, | ||
], | ||
}, | ||
} satisfies JestConfigWithTsJest; |
17 changes: 0 additions & 17 deletions
17
examples/example-app-monorepo/apps/app1/jest-isolated.config.js
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
examples/example-app-monorepo/apps/app1/jest-isolated.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import presets from 'jest-preset-angular/presets'; | ||
import type { JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
import jestCfg from './jest.config'; | ||
|
||
export default { | ||
...jestCfg, | ||
transform: { | ||
'^.+\\.(ts|js|mjs|html|svg)$': [ | ||
'jest-preset-angular', | ||
{ | ||
...presets.defaultTransformerOptions, | ||
isolatedModules: true, | ||
}, | ||
], | ||
}, | ||
} satisfies JestConfigWithTsJest; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { pathsToModuleNameMapper, type JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
import { compilerOptions } from './tsconfig.json'; | ||
|
||
export default { | ||
displayName: 'app1', | ||
preset: 'jest-preset-angular', | ||
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'], | ||
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>' }), | ||
} satisfies JestConfigWithTsJest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type { JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
export default { | ||
projects: ['<rootDir>/apps/app1/jest-esm-isolated.config.ts', '<rootDir>/libs/user/jest-esm-isolated.config.ts'], | ||
} satisfies JestConfigWithTsJest; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type { JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
export default { | ||
projects: ['<rootDir>/apps/app1/jest-esm.config.ts', '<rootDir>/libs/user/jest-esm.config.ts'], | ||
} satisfies JestConfigWithTsJest; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type { JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
export default { | ||
projects: ['<rootDir>/apps/app1/jest-isolated.config.ts', '<rootDir>/libs/user/jest-isolated.config.ts'], | ||
} satisfies JestConfigWithTsJest; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type { JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
export default { | ||
projects: ['<rootDir>/apps/app1', '<rootDir>/libs/user'], | ||
} satisfies JestConfigWithTsJest; |
19 changes: 0 additions & 19 deletions
19
examples/example-app-monorepo/libs/user/jest-esm-isolated.config.mjs
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
examples/example-app-monorepo/libs/user/jest-esm-isolated.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
import jestCfg from './jest-esm.config'; | ||
|
||
export default { | ||
...jestCfg, | ||
transform: { | ||
'^.+\\.(ts|js|html|svg)$': [ | ||
'jest-preset-angular', | ||
{ | ||
tsconfig: '<rootDir>/tsconfig-esm.spec.json', | ||
stringifyContentPathRegex: '\\.(html|svg)$', | ||
isolatedModules: true, | ||
useESM: true, | ||
}, | ||
], | ||
}, | ||
} satisfies JestConfigWithTsJest; |
24 changes: 0 additions & 24 deletions
24
examples/example-app-monorepo/libs/user/jest-esm.config.mjs
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
examples/example-app-monorepo/libs/user/jest-esm.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import ngPreset from 'jest-preset-angular/presets'; | ||
import type { JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
export default { | ||
...ngPreset.defaultsESM, | ||
displayName: 'user-lib', | ||
moduleNameMapper: { | ||
tslib: 'tslib/tslib.es6.js', | ||
rxjs: '<rootDir>/../../node_modules/rxjs/dist/bundles/rxjs.umd.js', | ||
}, | ||
setupFilesAfterEnv: ['<rootDir>/setup-jest-esm.ts'], | ||
transform: { | ||
'^.+\\.(ts|js|html|svg)$': [ | ||
'jest-preset-angular', | ||
{ | ||
tsconfig: '<rootDir>/tsconfig-esm.spec.json', | ||
stringifyContentPathRegex: '\\.(html|svg)$', | ||
useESM: true, | ||
}, | ||
], | ||
}, | ||
} satisfies JestConfigWithTsJest; |
17 changes: 17 additions & 0 deletions
17
examples/example-app-monorepo/libs/user/jest-isolated.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import presets from 'jest-preset-angular/presets'; | ||
import type { JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
import jestCfg from './jest.config'; | ||
|
||
export default { | ||
...jestCfg, | ||
transform: { | ||
'^.+\\.(ts|js|mjs|html|svg)$': [ | ||
'jest-preset-angular', | ||
{ | ||
...presets.defaultTransformerOptions, | ||
isolatedModules: true, | ||
}, | ||
], | ||
}, | ||
} satisfies JestConfigWithTsJest; |
7 changes: 4 additions & 3 deletions
7
...ple-app-monorepo/libs/user/jest.config.js → ...ple-app-monorepo/libs/user/jest.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ | ||
module.exports = { | ||
import type { JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
export default { | ||
displayName: 'user-lib', | ||
preset: 'jest-preset-angular', | ||
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'], | ||
}; | ||
} satisfies JestConfigWithTsJest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
import jestCfg from './jest-esm.config'; | ||
|
||
export default { | ||
...jestCfg, | ||
transform: { | ||
'^.+\\.(ts|js|html|svg)$': [ | ||
'jest-preset-angular', | ||
{ | ||
tsconfig: '<rootDir>/tsconfig-esm.spec.json', | ||
stringifyContentPathRegex: '\\.(html|svg)$', | ||
isolatedModules: true, | ||
useESM: true, | ||
}, | ||
], | ||
}, | ||
} satisfies JestConfigWithTsJest; |
Oops, something went wrong.