Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbay committed Dec 17, 2016
1 parent d18c876 commit adb3998
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/jest-cli/src/reporters/__tests__/CoverageReporter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
jest
.mock('fs')
.mock('istanbul-lib-coverage')
.mock('istanbul-lib-source-maps')
.mock('istanbul-api');

let libCoverage;
let libSourceMaps;
let CoverageReporter;
let istanbulApi;

Expand All @@ -27,6 +29,7 @@ beforeEach(() => {

CoverageReporter = require('../CoverageReporter');
libCoverage = require('istanbul-lib-coverage');
libSourceMaps = require('istanbul-lib-source-maps');
});

describe('onRunComplete', () => {
Expand Down Expand Up @@ -66,6 +69,14 @@ describe('onRunComplete', () => {
};
});

libSourceMaps.createSourceMapStore = jest.fn(() => {
return {
transformCoverage(map) {
return {map};
},
};
});

testReporter = new CoverageReporter();
testReporter.log = jest.fn();
});
Expand Down

0 comments on commit adb3998

Please sign in to comment.