Skip to content
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

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

Merged
merged 3 commits into from
Sep 16, 2022
Merged

Conversation

iamWing
Copy link
Member

@iamWing iamWing commented Sep 16, 2022

Summary

Upgraded packages jest & ts-jest to v29 and moved ts-jest config to transform from globals in jest.config.mjs as config under globals has been deprecated in ts-jest v29.0.0 (see: https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md#2900-2022-09-08)

Also added type information for the exported Jest config object, and simplified the regex of testMatch in jest.config.mjs.

Test plan

Verified by running npm test / npm run jest to confirm the test cases can be run normally after the changes are made.

$ npm test

> electron-react-typescript-webpack-boilerplate@4.1.2 test
> npm run lint && npm run jest


> electron-react-typescript-webpack-boilerplate@4.1.2 lint
> eslint . --cache --ext js,jsx,cjs,mjs,ts,tsx


> electron-react-typescript-webpack-boilerplate@4.1.2 jest
> cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules NODE_NO_WARNINGS=1 jest

 PASS  tests/utils/node-env.spec.ts
  ✓ NODE_ENV=test (6 ms)
  ✓ NODE_ENV=development (1 ms)
  ✓ NODE_ENV=production (2 ms)

 PASS  tests/main/main.spec.ts
  ✓ Private props exported for unit tests (3 ms)
  ✓ func createWindow() (1 ms)

--------------|---------|----------|---------|---------|-------------------
File          | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
--------------|---------|----------|---------|---------|-------------------
All files     |   68.18 |    42.85 |      50 |   78.94 |                   
 main         |   63.15 |    42.85 |      50 |      75 |                   
  main.ts     |   63.15 |    42.85 |      50 |      75 | 31,42,50,55       
 utils        |     100 |      100 |     100 |     100 |                   
  node-env.ts |     100 |      100 |     100 |     100 |                   
--------------|---------|----------|---------|---------|-------------------
Test Suites: 2 passed, 2 total
Tests:       5 passed, 5 total
Snapshots:   0 total
Time:        4.233 s, estimated 7 s
Ran all test suites.

- `@types/jest` - `28.1.6` -> `29.0.2`
- `jest` - `28.1.3` - `29.0.3`
- `ts-jest` - `28.0.7` - `29.0.1`
- Moved `ts-jest` config to `transform` as config under `globals` is now deprecated.
- Added type def for Jest config object.
- Simplified regex for Jest `testMatch` value.
@iamWing iamWing merged commit c72f51b into develop Sep 16, 2022
iamWing added a commit that referenced this pull request Sep 16, 2022
@iamWing iamWing deleted the packages/ts-jest-v29 branch September 16, 2022 01:57
@iamWing iamWing changed the title packages: upgrade jest & ts-jest to v29 chore: upgrade jest & ts-jest to v29 Oct 10, 2022
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new pull request for related bugs.
Please note this issue tracker is not a help forum. We recommend using Discussions for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant