Skip to content

Coverage not collected in Embroider >3.1 #386

@chrismllr

Description

@chrismllr

Versions:

"ember-cli": "~4.12.1",
"@embroider/compat": "^3.2.1",
"@embroider/core": "^3.2.1",
"@embroider/webpack": "^3.1.5",
"ember-cli-code-coverage": "2.0.0"

Utilizing embroider >2 (as of writing, 3.2) coverage is not generated.

From initial debugging, a couple things ive noticed:

  • The stableWorkspaceDir (@embroider/compat) method returns a directory that does not match the build directory that is printed when the build completes before tests are run (Built in ....) -- Unsure if this is actually an issue, or Istanbul simply needs an empty directory to work from
  • testMiddleware method is registered, but the app never POSTs back (coverageHandler is never invoked)
  • If running with --server flag, sendCoverage is invoked, but window.__coverage__ is empty

Repro: https://github.com/chrismllr/repro-code-coverage-embroider

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions