odoo / o-spreadsheet

Other
193 stars 44 forks source link

[IMP] tests: drop ts-jest in favor of swc/jest #4709

Closed VincentSchippefilt closed 2 months ago

VincentSchippefilt commented 2 months ago

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:

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

VincentSchippefilt commented 2 months ago

robodoo fw=no

robodoo commented 2 months ago

Pull request status dashboard

robodoo commented 2 months ago

Forward-port disabled.

VincentSchippefilt commented 2 months ago

robodoo rebase-ff

robodoo commented 2 months ago

Merge method set to rebase and fast-forward.