Skip to content

Commit

Permalink
fix: define export path for jest-preset (#896)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnpnl authored Mar 23, 2021
1 parent ee76e0a commit 218b217
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions e2e/test-app-v10/jest-cjs-iso.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const baseConfig = require('./jest.config');
const defaultPreset = require('jest-preset-angular/jest-preset');

/** @type {import('ts-jest/dist/types').ProjectConfigTsJest} */
module.exports = {
...baseConfig,
preset: 'jest-preset-angular',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig-cjs.spec.json',
stringifyContentPathRegex: '\\.html$',
...defaultPreset.globals['ts-jest'],
isolatedModules: true,
}
},
Expand Down
5 changes: 2 additions & 3 deletions e2e/test-app-v10/jest-esm-iso.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const baseConfig = require('./jest.config');
const basePreset = require('jest-preset-angular/presets');

/** @type {import('ts-jest/dist/types').ProjectConfigTsJest} */
module.exports = {
...baseConfig,
preset: 'jest-preset-angular/presets/defaults-esm',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig-esm.spec.json',
stringifyContentPathRegex: '\\.html$',
useESM: true,
...basePreset.defaultsESM.globals['ts-jest'],
isolatedModules: true,
}
},
Expand Down
4 changes: 2 additions & 2 deletions e2e/test-app-v11/jest-cjs-iso.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const baseConfig = require('./jest.config');
const defaultPreset = require('jest-preset-angular/jest-preset');

/** @type {import('ts-jest/dist/types').ProjectConfigTsJest} */
module.exports = {
...baseConfig,
preset: 'jest-preset-angular',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig-cjs.spec.json',
stringifyContentPathRegex: '\\.html$',
...defaultPreset.globals['ts-jest'],
isolatedModules: true,
}
},
Expand Down
5 changes: 2 additions & 3 deletions e2e/test-app-v11/jest-esm-iso.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const baseConfig = require('./jest.config');
const basePreset = require('jest-preset-angular/presets');

/** @type {import('ts-jest/dist/types').ProjectConfigTsJest} */
module.exports = {
...baseConfig,
preset: 'jest-preset-angular/presets/defaults-esm',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig-esm.spec.json',
stringifyContentPathRegex: '\\.html$',
useESM: true,
...basePreset.defaultsESM.globals['ts-jest'],
isolatedModules: true,
}
},
Expand Down
4 changes: 2 additions & 2 deletions e2e/test-app-v9/jest-cjs-iso.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const baseConfig = require('./jest.config');
const defaultPreset = require('jest-preset-angular/jest-preset');

/** @type {import('ts-jest/dist/types').ProjectConfigTsJest} */
module.exports = {
...baseConfig,
preset: 'jest-preset-angular',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig-cjs.spec.json',
stringifyContentPathRegex: '\\.html$',
...defaultPreset.globals['ts-jest'],
isolatedModules: true,
}
},
Expand Down
5 changes: 2 additions & 3 deletions e2e/test-app-v9/jest-esm-iso.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const baseConfig = require('./jest.config');
const basePreset = require('jest-preset-angular/presets');

/** @type {import('ts-jest/dist/types').ProjectConfigTsJest} */
module.exports = {
...baseConfig,
preset: 'jest-preset-angular/presets/defaults-esm',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig-esm.spec.json',
stringifyContentPathRegex: '\\.html$',
useESM: true,
...basePreset.defaultsESM.globals['ts-jest'],
isolatedModules: true,
}
},
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"main": "build/index.js",
"exports": {
".": "./dist/index.js",
"./presets": "./jest-preset.js",
"./presets": "./presets/index.js",
"./jest-preset": "./jest-preset.js",
"./setup-jest": "./setup-jest.js",
"./ngcc-jest-processor": "./ngcc-jest-processor.js",
"./package.json": "./package.json"
Expand Down

0 comments on commit 218b217

Please sign in to comment.