Skip to content

[Bug] Code Coverage highlighting wrong lines (angular) #282

Open

Description

Describe the bug

The wrong sections are highlighted when running --coverage.

Steps to reproduce the behavior

I followed the init step as suggested in https://storybook.js.org/tutorials/intro-to-storybook/angular/en/get-started/
followed by the setup of coverage reporting described here: https://storybook.js.org/docs/angular/writing-tests/test-coverage
which refers to https://github.com/yannbf/storybook-coverage-recipes/tree/main/angular for testing coverage in angular.

Here are the steps I took:

  1. npx degit chromaui/intro-storybook-angular-template storybook-coverage
  2. npm i
  3. npm i @jsdevtools/coverage-istanbul-loader --save-dev
  4. npm i @storybook/test-runner --save-dev
  5. (added code to main.js and package.json)
  6. npm run storybook
  7. npm run test:coverage
  8. npm run test:coverage:serve

You can see the full code here:
https://github.com/tomnar/storybook-coverage

Expected behavior

The correct lines should be highlighted

Screenshots and/or logs

image

Environment

  • OS: Windows
  • Node.js version: 16.18.0
  • NPM version: 8.19.2
  • Browser (if applicable): Chrome

Additional context

I just noticed that storybooks example uses an old version of angular (13). However, I have the same issue in my own storybook, which is based on angular 15. Am I missing something?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions