From 9f513826a0f4f8a23a3c4eb5f14cef2b400f4471 Mon Sep 17 00:00:00 2001 From: Paul Roebuck Date: Wed, 17 Apr 2019 16:36:21 -0500 Subject: [PATCH] test(reporters/json.spec.js): Remove noise output from JSON reporter test --- test/reporters/json.spec.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/reporters/json.spec.js b/test/reporters/json.spec.js index bf923bb171..5d7a37c564 100644 --- a/test/reporters/json.spec.js +++ b/test/reporters/json.spec.js @@ -1,5 +1,6 @@ 'use strict'; +var sinon = require('sinon'); var Mocha = require('../../'); var Suite = Mocha.Suite; var Runner = Mocha.Runner; @@ -28,7 +29,9 @@ describe('JSON reporter', function() { }) ); + var stdoutWrite = sinon.stub(process.stdout, 'write'); runner.run(function(failureCount) { + stdoutWrite.restore(); expect(runner, 'to satisfy', { testResults: { failures: [ @@ -49,7 +52,9 @@ describe('JSON reporter', function() { it('should have 1 test pending', function(done) { suite.addTest(new Test(testTitle)); + var stdoutWrite = sinon.stub(process.stdout, 'write'); runner.run(function(failureCount) { + stdoutWrite.restore(); expect(runner, 'to satisfy', { testResults: { pending: [ @@ -78,7 +83,9 @@ describe('JSON reporter', function() { }) ); + var stdoutWrite = sinon.stub(process.stdout, 'write'); runner.run(function(failureCount) { + stdoutWrite.restore(); expect(runner, 'to satisfy', { testResults: { failures: [