-
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.
Co-authored-by: Ismaïl Ouazzany <iouazzany@smartadserver.com> Co-authored-by: Tim <tja2353@gmail.com>
- Loading branch information
1 parent
54ed21c
commit b0b57a7
Showing
73 changed files
with
583 additions
and
462 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
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,14 +1,9 @@ | ||
module.exports = { | ||
globals: { | ||
'ts-jest': { | ||
stringifyContentPathRegex: '\\.html$', | ||
}, | ||
}, | ||
resolver: '<rootDir>/../../../build/resolvers/ng-jest-resolver', | ||
setupFilesAfterEnv: ['<rootDir>/../../../setup-jest.js'], | ||
testEnvironment: 'jsdom', | ||
transform: { | ||
'^.+\\.(ts|js|mjs|html)$': '<rootDir>/../../../build/index.js', | ||
'^.+\\.(ts|js|mjs|html)$': ['<rootDir>/../../../build/index.js', require('./ts-jest.config')], | ||
}, | ||
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], | ||
}; |
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 @@ | ||
module.exports = { | ||
stringifyContentPathRegex: '\\.html$', | ||
}; |
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,17 +1,9 @@ | ||
module.exports = { | ||
globals: { | ||
'ts-jest': { | ||
tsconfig: { | ||
/** Angular doesn't work with ES2017+ | ||
* see https://github.com/angular/components/issues/21632#issuecomment-764975917 | ||
*/ | ||
target: 'ES2016', | ||
}, | ||
}, | ||
}, | ||
resolver: '<rootDir>/../../build/resolvers/ng-jest-resolver', | ||
testEnvironment: 'jsdom', | ||
setupFilesAfterEnv: ['<rootDir>/../../setup-jest.js'], | ||
transform: { '^.+\\.(ts|mjs|js|html)$': '<rootDir>/../../build/index.js' }, | ||
transform: { | ||
'^.+\\.(ts|mjs|js|html)$': ['<rootDir>/../../build/index.js', require('./ts-jest.config')], | ||
}, | ||
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], | ||
}; |
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,8 @@ | ||
module.exports = { | ||
tsconfig: { | ||
/** Angular doesn't work with ES2017+ | ||
* see https://github.com/angular/components/issues/21632#issuecomment-764975917 | ||
*/ | ||
target: 'ES2016', | ||
}, | ||
}; |
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,11 +1,11 @@ | ||
const baseCfg = require('./jest.config'); | ||
|
||
module.exports = { | ||
...baseCfg, | ||
globals: { | ||
'ts-jest': { | ||
...baseCfg.globals['ts-jest'], | ||
isolatedModules: true, | ||
}, | ||
transform: { | ||
'^.+\\.(ts|js|html)$': [ | ||
'<rootDir>/../../build/index.js', | ||
{ | ||
...require('./ts-jest.config'), | ||
isolatedModules: true, | ||
}, | ||
], | ||
}, | ||
}; |
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,5 @@ | ||
module.exports = { | ||
globals: { | ||
'ts-jest': { | ||
babelConfig: true, | ||
}, | ||
}, | ||
transform: { | ||
'^.+\\.(ts|js|html)$': '<rootDir>/../../build/index.js', | ||
'^.+\\.(ts|js|html)$': ['<rootDir>/../../build/index.js', require('./ts-jest.config')], | ||
}, | ||
}; |
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 @@ | ||
module.exports = { | ||
babelConfig: true, | ||
}; |
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
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
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,15 +1,17 @@ | ||
module.exports = { | ||
globals: { | ||
'ts-jest': { | ||
tsconfig: 'tsconfig.spec.json', | ||
isolatedModules: true, | ||
}, | ||
ngJest: { | ||
processWithEsbuild: ['**/node_modules/lodash-es/*.js'], | ||
}, | ||
}, | ||
transform: { | ||
'^.+\\.(ts|js|mjs)$': '<rootDir>/../../build/index.js', | ||
'^.+\\.(ts|js|mjs)$': [ | ||
'<rootDir>/../../build/index.js', | ||
{ | ||
tsconfig: 'tsconfig.spec.json', | ||
isolatedModules: true, | ||
}, | ||
], | ||
}, | ||
transformIgnorePatterns: ['node_modules/(?!lodash-es)'], | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
stringifyContentPathRegex: '\\.html$', | ||
}; |
19 changes: 11 additions & 8 deletions
19
examples/example-app-monorepo/apps/app1/jest-esm-isolated.config.mjs
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
20 changes: 12 additions & 8 deletions
20
examples/example-app-monorepo/apps/app1/jest-esm.config.mjs
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,20 +1,24 @@ | ||
import ngPreset from 'jest-preset-angular/presets/index.js'; | ||
|
||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ | ||
const jestConfig = { | ||
...ngPreset.defaultsESM, | ||
displayName: 'app1', | ||
globals: { | ||
'ts-jest': { | ||
...ngPreset.defaultsESM.globals["ts-jest"], | ||
tsconfig: '<rootDir>/tsconfig-esm.spec.json', | ||
}, | ||
}, | ||
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, | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
export default jestConfig; |
Oops, something went wrong.