From adb39980cff76423fc229570207e5d703deb4310 Mon Sep 17 00:00:00 2001 From: Justin Bay Date: Sat, 17 Dec 2016 18:28:41 -0500 Subject: [PATCH] fix unit tests --- .../src/reporters/__tests__/CoverageReporter-test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/jest-cli/src/reporters/__tests__/CoverageReporter-test.js b/packages/jest-cli/src/reporters/__tests__/CoverageReporter-test.js index 9c6eaf68a473..2bcd9db1c393 100644 --- a/packages/jest-cli/src/reporters/__tests__/CoverageReporter-test.js +++ b/packages/jest-cli/src/reporters/__tests__/CoverageReporter-test.js @@ -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; @@ -27,6 +29,7 @@ beforeEach(() => { CoverageReporter = require('../CoverageReporter'); libCoverage = require('istanbul-lib-coverage'); + libSourceMaps = require('istanbul-lib-source-maps'); }); describe('onRunComplete', () => { @@ -66,6 +69,14 @@ describe('onRunComplete', () => { }; }); + libSourceMaps.createSourceMapStore = jest.fn(() => { + return { + transformCoverage(map) { + return {map}; + }, + }; + }); + testReporter = new CoverageReporter(); testReporter.log = jest.fn(); });