podkrepi-bg / api

Nest.js REST backend for charity platform Podkrepi.bg https://podkrepi.bg/swagger

Home Page:https://podkrepi.bg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Investigate and fix jest warnings

kachar opened this issue · comments

Which area(s) of Podkrepi.bg are affected? (leave empty if unsure)

Testing

Describe the Bug

During the testing phase we observe the following in the logs

● Validation Warning:

  Unknown option "coverageDirectory" with value "../../coverage/apps/api" was found.
  This is probably a typing mistake. Fixing it will remove this message.

  Configuration Documentation:
  https://jestjs.io/docs/configuration

ts-jest[ts-jest-transformer] (WARN) Define `ts-jest` config under `globals` is deprecated. Please do
transform: {
    <transform_regex>: ['ts-jest', { /* ts-jest config goes here in Jest */ }],
},

To Reproduce

run

yarn jest

Expected Behavior

No warnings

Which browser are you using? (if relevant)

No response

Just some more context to consider and potentially save some time for whoever takes it:
The warnings appeared after me upgrading jest and ts-jest. When I tried to fix the message "ts-jest config under globals is deprecated" the tests time suddenly increased from 17secs to 124 secs.
So while trying to preserve the speed, I found out that there is a perf issue with ts-test - see item 3. and item 5. in this article https://blog.devgenius.io/make-your-jest-tests-upto-10x-faster-d751b3428ded .
Item 5 in the article is recommending a faster library swc-test https://swc.rs/docs/usage/jest , unfortunately I couldn't quickly migrate to it as I lack knowledge of the necessary configs.