-
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.
refactor: deprecate
ngcc-jest-processor
and replace with global set…
…up (#1275)
- Loading branch information
Showing
19 changed files
with
34 additions
and
18 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
require('jest-preset-angular/ngcc-jest-processor'); | ||
const { pathsToModuleNameMapper } = require('ts-jest/utils'); | ||
const { paths } = require('./tsconfig.json').compilerOptions; | ||
|
||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
module.exports = { | ||
preset: 'jest-preset-angular', | ||
globalSetup: 'jest-preset-angular/global-setup', | ||
moduleNameMapper: pathsToModuleNameMapper(paths, { prefix: '<rootDir>' }), | ||
setupFilesAfterEnv: ['<rootDir>/setup-jest.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,4 +1,5 @@ | ||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
module.exports = { | ||
globalSetup: 'jest-preset-angular/global-setup', | ||
projects: ['<rootDir>/projects/app1/jest-esm.config.js', '<rootDir>/projects/app2/jest-esm.config.js'], | ||
}; |
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,4 +1,5 @@ | ||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
module.exports = { | ||
globalSetup: 'jest-preset-angular/global-setup', | ||
projects: ['<rootDir>/projects/app1', '<rootDir>/projects/app2'], | ||
}; |
2 changes: 0 additions & 2 deletions
2
examples/example-app-v12-monorepo/projects/app1/jest-esm.config.js
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
2 changes: 0 additions & 2 deletions
2
examples/example-app-v12-monorepo/projects/app1/jest.config.js
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
2 changes: 0 additions & 2 deletions
2
examples/example-app-v12-monorepo/projects/app2/jest-esm.config.js
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
2 changes: 0 additions & 2 deletions
2
examples/example-app-v12-monorepo/projects/app2/jest.config.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
require('jest-preset-angular/ngcc-jest-processor'); | ||
const { pathsToModuleNameMapper } = require('ts-jest/utils'); | ||
const { paths } = require('./tsconfig.json').compilerOptions; | ||
|
||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
module.exports = { | ||
preset: 'jest-preset-angular', | ||
globalSetup: 'jest-preset-angular/global-setup', | ||
moduleNameMapper: pathsToModuleNameMapper(paths, { prefix: '<rootDir>' }), | ||
setupFilesAfterEnv: ['<rootDir>/setup-jest.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
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,10 +1,10 @@ | ||
require('jest-preset-angular/ngcc-jest-processor'); | ||
const { pathsToModuleNameMapper } = require('ts-jest/utils'); | ||
const { paths } = require('./tsconfig.json').compilerOptions; | ||
|
||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
module.exports = { | ||
preset: 'jest-preset-angular', | ||
globalSetup: 'jest-preset-angular/global-setup', | ||
moduleNameMapper: pathsToModuleNameMapper(paths, { prefix: '<rootDir>' }), | ||
setupFilesAfterEnv: ['<rootDir>/setup-jest.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
2 changes: 1 addition & 1 deletion
2
examples/example-app-yarn-workspace/packages/angular-app/jest.config.js
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,10 +1,10 @@ | ||
require('jest-preset-angular/ngcc-jest-processor'); | ||
const { pathsToModuleNameMapper } = require('ts-jest/utils'); | ||
const { paths } = require('./tsconfig.json').compilerOptions; | ||
|
||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
module.exports = { | ||
preset: 'jest-preset-angular', | ||
globalSetup: 'jest-preset-angular/global-setup', | ||
moduleNameMapper: pathsToModuleNameMapper(paths, { prefix: '<rootDir>' }), | ||
setupFilesAfterEnv: ['<rootDir>/setup-jest.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 @@ | ||
module.exports = require('./build/config/global-setup'); |
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 +1,11 @@ | ||
console.warn( | ||
'ng-jest-processor is deprecated and will be removed in the next major version v12.' + | ||
' Please use jest-preset-angular/global-setup in Jest config instead, e.g. \n' + | ||
` | ||
module.exports = { | ||
globalSetup: 'jest-preset-angular/global-setup', | ||
}; | ||
` | ||
); | ||
|
||
module.exports = require('./build/utils/ngcc-jest-processor'); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export = async () => { | ||
await import('../utils/ngcc-jest-processor'); | ||
}; |
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