Skip to content

Coverage appears to be blocked for tests wrapped in a transaction #36

@Stuwert

Description

@Stuwert

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions