Skip to content
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
gearsdigital opened this issue Dec 18, 2015 · 0 comments
Open

Shows code as covered which is obviously not covered #99

gearsdigital opened this issue Dec 18, 2015 · 0 comments

Comments

@gearsdigital
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant