When I wrap tests in the runInTransaction function, jest coverage stops tracking coverage for functions and lines.
without runInTransaction
-------------------------------------------|---------|----------|---------|---------|---------------------------------------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------------------------------------|---------|----------|---------|---------|---------------------------------------------------
src/domains/fetchData/rules | 14.19 | 14.28 | 14.28 | 14.19 |
constants.ts | 100 | 100 | 100 | 100 |
fetchAcademicAndEmployerPartnerRules.ts | 100 | 100 | 100 | 100 |
with runInTransaction
-------------------------------------------|---------|----------|---------|---------|------------------------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------------------------------------|---------|----------|---------|---------|------------------------------------
src/domains/fetchData/rules | 7.71 | 0 | 0 | 7.71 |
constants.ts | 100 | 100 | 100 | 100 |
fetchAcademicAndEmployerPartnerRules.ts | 27.58 | 100 | 0 | 27.58 | 9-29
running the same tests both times.
When I wrap tests in the
runInTransactionfunction, jest coverage stops tracking coverage for functions and lines.without
runInTransactionwith
runInTransactionrunning the same tests both times.