Skip to content

Commit 8a0bd65

Browse files
authored
refactor(config): deprecate import setup file from index.js (#854)
DEPRECATION Import setup file via `import 'jest-preset-angular'` is deprecated in favor of `import 'jest-preset-angular/setup-jest'`
1 parent e8c9689 commit 8a0bd65

File tree

9 files changed

+263
-200
lines changed

9 files changed

+263
-200
lines changed

commitlint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
extends: ['@commitlint/config-conventional'],
2+
extends: ['@commitlint/config-angular'],
33
}

e2e/test-app-v10/setup-jest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import 'jest-preset-angular';
1+
import 'jest-preset-angular/setup-jest';
22
import './jest-global-mocks';

e2e/test-app-v11/setup-jest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import 'jest-preset-angular';
1+
import 'jest-preset-angular/setup-jest';
22
import './jest-global-mocks';

e2e/test-app-v9/setup-jest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import 'jest-preset-angular';
1+
import 'jest-preset-angular/setup-jest';
22
import './jest-global-mocks';

index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1+
const { rootLogger } = require('ts-jest/dist/utils/logger');
2+
3+
rootLogger.warn(
4+
"Import setup jest file via `import 'jest-preset-angular';` is deprecated and will be removed in v9.0.0." +
5+
" Please switch to `import 'jest-preset-angular/setup-jest';`"
6+
);
7+
18
module.exports = require('./build/setup-jest.js');

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
},
3535
"devDependencies": {
3636
"@angular-eslint/eslint-plugin": "latest",
37-
"@commitlint/cli": "9.x",
38-
"@commitlint/config-conventional": "9.x",
37+
"@commitlint/cli": "latest",
38+
"@commitlint/config-angular": "latest",
3939
"@types/jest": "26.x",
4040
"@types/node": "12.x",
4141
"@typescript-eslint/eslint-plugin": "latest",

scripts/e2e.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const executeTest = (projectRealPath) => {
4444

4545
copySync(join(cwd, 'jest-preset.js'), `${presetDir}/jest-preset.js`);
4646
copySync(join(cwd, 'index.js'), `${presetDir}/index.js`);
47+
copySync(join(cwd, 'setup-jest.js'), `${presetDir}/setup-jest.js`);
4748
copySync(join(cwd, 'ngcc-jest-processor.js'), `${presetDir}/ngcc-jest-processor.js`);
4849
copySync(join(cwd, 'package.json'), `${presetDir}/package.json`);
4950
copySync(join(cwd, 'build'), `${presetDir}/build`);

setup-jest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./build/setup-jest');

yarn.lock

Lines changed: 248 additions & 194 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)