SWC (speedy web compiler) is an rust-based faster alternative to the traditional typescript transpiler tsc. SInce it does not support typechecking, we cannot only rely on it in order to generate our declaration files our build our library. We can however leverage the already existing integration with jest, expecially the package @swc/jest that works as an alternative to js-test.
In order to preserve the typechecking of the test files, we alter the test command to first run a simple typecheck with tsc and then run the test suite with @swc/jest as a TS transpiler.
Some pros:
Better execution time for the whole test suite
running a standalone test way faster
a pre-step of typecheck takes less time than currently beacause jest will keep running every test file and will not stop its execution because of a single file in error
Benchmark
Running command npm run test -- -w 50% - 11178 tests:
Before: 131 secondes
After: 82 secondes (17 of typecheck + 68 of actual tests transpiled
and run
SWC (speedy web compiler) is an rust-based faster alternative to the traditional typescript transpiler
tsc
. SInce it does not support typechecking, we cannot only rely on it in order to generate our declaration files our build our library. We can however leverage the already existing integration with jest, expecially the package@swc/jest
that works as an alternative tojs-test
.In order to preserve the typechecking of the test files, we alter the
test
command to first run a simple typecheck withtsc
and then run the test suite with@swc/jest
as a TS transpiler.Some pros:
Benchmark
Running command
npm run test -- -w 50%
- 11178 tests:Before: 131 secondes After: 82 secondes (17 of typecheck + 68 of actual tests transpiled and run
On Runbot
closes odoo/o-spreadsheet#4649
Before: 250 secondes After: 122 secondes Task: 4049142
Description:
description of this task, what is implemented and why it is implemented that way.
Task: : TASK_ID
review checklist