Skip to content

Commit 07ea876

Browse files
authored
Remove noise output from JSON reporter test (#3881)
1 parent 31c019e commit 07ea876

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/reporters/json.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22

3+
var sinon = require('sinon');
34
var Mocha = require('../../');
45
var Suite = Mocha.Suite;
56
var Runner = Mocha.Runner;
@@ -28,7 +29,9 @@ describe('JSON reporter', function() {
2829
})
2930
);
3031

32+
var stdoutWrite = sinon.stub(process.stdout, 'write');
3133
runner.run(function(failureCount) {
34+
stdoutWrite.restore();
3235
expect(runner, 'to satisfy', {
3336
testResults: {
3437
failures: [
@@ -49,7 +52,9 @@ describe('JSON reporter', function() {
4952
it('should have 1 test pending', function(done) {
5053
suite.addTest(new Test(testTitle));
5154

55+
var stdoutWrite = sinon.stub(process.stdout, 'write');
5256
runner.run(function(failureCount) {
57+
stdoutWrite.restore();
5358
expect(runner, 'to satisfy', {
5459
testResults: {
5560
pending: [
@@ -78,7 +83,9 @@ describe('JSON reporter', function() {
7883
})
7984
);
8085

86+
var stdoutWrite = sinon.stub(process.stdout, 'write');
8187
runner.run(function(failureCount) {
88+
stdoutWrite.restore();
8289
expect(runner, 'to satisfy', {
8390
testResults: {
8491
failures: [

0 commit comments

Comments
 (0)