Skip to content

Commit

Permalink
chore(test): switch from ts-jest to @swc/jest (#302)
Browse files Browse the repository at this point in the history
This makes the whole test run faster because `swc` uses native binaries
to transpile the TypeScript code.
This is particularly noticeable when you run a single test in your IDE.

The gain (i.e. the difference between execution with swc and with
ts-jest) will increase as there are more TypeScript files to transpile
(both in the tests and in the library).

Unlike `ts-jest`, `swc` does no type checking (it just transpiles). A
new npm script is available to type-check the test code.
  • Loading branch information
tbouffard authored Sep 23, 2024
1 parent 2608e31 commit 245be0c
Show file tree
Hide file tree
Showing 6 changed files with 288 additions and 234 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ updates:
patterns:
- "@jest/*"
- "@testing-library/*"
- "@swc/*"
- "jest"
- "jest-*"
- "ts-jest"

- package-ecosystem: "github-actions"
# Workflow files stored in the default location of `.github/workflows`
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
uses: ./.github/actions/build-setup
- name: Build Library
run: npm run build -w packages/addons
- name: Test compilation
run: npm run test-check -w packages/addons
- name: Test
id: 'test'
run: npm test -w packages/addons -- --coverage
Expand Down
Loading

0 comments on commit 245be0c

Please sign in to comment.