Skip to content
This repository was archived by the owner on Dec 31, 2019. It is now read-only.
This repository was archived by the owner on Dec 31, 2019. It is now read-only.

Shows code as covered which is obviously not covered #99

Open

Description

@gearsdigital

Currently I'm running into an issue described here. karma-runner/karma-coverage#185. I'm quite unsure if this is related to isparta, istanbul or my-brain. Maybe i miss something?

Let me explain what's going on. I've a simple library, written in ES6, which i want to test.

Example code: https://github.com/gearsdigital/stunning-octo-train

Given

// src/utilities.js
export function objectLength(obj) {
    return Object.keys(obj).length;
}

Spec

// test/utilities-spec.js
import {objectLength} from '../src/utilities';
describe('utilities', function () { });

Expected Result

The generated coverage report looks fine so far:

report

Unexpected Result

If i want to reuse the method written above and execute it, the overage report looks wrong for me. There are no tests for this method.

report2

I wrote about the same problem here: http://stackoverflow.com/questions/34291595/karma-coverage-report-shows-code-as-covered-which-is-obviously-not-covered

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions