[FW][FIX] config: Avoid compiling test files #1321
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Currently, when running a
build:*
script, we compile both src andtest files from TS to JS.
There is no need to compile the test files as the step is only useful to
utlimately rollup the
src
files.Furthermore, the test files (and src) are recompiled by jest when
running the tests.
Benchmark
before :
rm -r dist && time mpm run build:js
real 0m8.321s
user 0m15.928s
sys 0m0.290s
after :
rm -r dist && time npm run build:js
real 0m5.563s
user 0m11.454s
sys 0m0.176s
[FIX] config: Feed dedicated tsconfig.json file to jest
Since 457fe70, we changed stopped compiling the
.ts
files in thetests
folders to save compilation time. Unfortunately, jest was usingthe very same file to compile (via
ts-jest
) and it actually needs tocompile
tests/setup/jest.setup.ts
to work properly.This commit introduces a new dedicated
tsconfig
file for ts-jest inorder to retain the improvements of 457fe70.
description of this task, what is implemented and why it is implemented that way.
Odoo task ID : TASK_ID
review checklist
Forward-Port-Of: #1319