Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

WIP - Fix disabling coverage for files that only contain flow-types #532

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/cli/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,13 @@ test('`fusion test` coverage', async t => {
// Look for something like coverage
t.ok(response.stdout.includes('Uncovered Line #s'));

// This file is outside of src and should not be included in coverage
t.ok(!response.stdout.includes('should-not-count-for-coverage.js'));

// These files instruments the istanbul ignore annotation and should not be included in coverage
t.ok(!response.stdout.includes('istanbul-ignore-coverage.js'));
t.ok(!response.stdout.includes('istanbul-ignore-coverage.flow.js'));

t.end();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* istanbul ignore file */
// @generated
// @flow
// This file should not be present in coverage due to the istanbul ignore file annotation.
// The `import *` syntax is required for this test case.
import * as FusionCore from 'fusion-core';

export type Something = FusionCore.Context;
4 changes: 4 additions & 0 deletions test/fixtures/test-jest-app/src/istanbul-ignore-coverage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* istanbul ignore file */
// @flow

export default function() {}
6 changes: 5 additions & 1 deletion test/fixtures/test-jest-app/src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// @flow
import {foo} from './foo.js';
import noop from './istanbul-ignore-coverage.js';
import type {Something} from './istanbul-ignore-coverage.flow.js';

export default function () {
export default function() {
noop();
return foo();
}