Skip to content

chore: upgrade jest & ts-jest to v29 #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG_V4+.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- File extension of Jest & Webpack config files to `mjs`.
- Jest config to move `ts-jest` config to `transform` ([#40])
- NPM `test` script to run scripts `lint` then `jest`.
- Rolled back the value of `moduleResolution` in `tsconfig` to `Node` (means
`.js` file extension on relative imports is now __OPTIONAL__).
- Enhanced function `pathsToESModuleNameMapper` in `jest.config.js` to return a
less clumsy mapping object.

### Updates on package dependencies

### Update
- Major version updates:
- `@types/jest` - `28.1.6` -> `29.0.2` ([#40])
- `jest` - `28.1.3` -> `29.0.3` ([#40])
- `ts-jest` - `28.0.7` -> `29.0.1` ([#40])

[#40]: https://github.com/Devtography/electron-react-typescript-webpack-boilerplate/pull/40

## [v4.1.2] - 2022-08-15
### Added
- Function `pathsToESModuleNameMapper` in `jest.config.js` to create the module
Expand Down
15 changes: 8 additions & 7 deletions jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,9 @@ function pathsToESModuleNameMapper() {
return esmMap;
}

/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
testEnvironment: 'node',
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json',
},
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
moduleNameMapper: pathsToESModuleNameMapper(),
modulePathIgnorePatterns: [
Expand All @@ -49,10 +45,15 @@ export default {
'<rootDir>/out',
],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: 'tsconfig.json',
},
],
},
testMatch: [
'**/tests/**/*.(spec|test).(ts?(x)|js?(x))',
'**/tests/**/*.(spec|test).([jt]s?(x))',
],
collectCoverage: true,
verbose: true,
Expand Down
Loading