From a85e55f39c3fe6d835fe6476889bf72710332652 Mon Sep 17 00:00:00 2001 From: juergba Date: Thu, 16 Apr 2020 12:06:46 +0200 Subject: [PATCH] more tests --- test/reporters/base.spec.js | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/test/reporters/base.spec.js b/test/reporters/base.spec.js index 744b92e69b..8e81223eab 100644 --- a/test/reporters/base.spec.js +++ b/test/reporters/base.spec.js @@ -426,25 +426,43 @@ describe('Base reporter', function() { }); describe('when reporter output immune to user test changes', function() { - var sandbox; var baseConsoleLog; beforeEach(function() { - sandbox = sinon.createSandbox(); sandbox.stub(console, 'log'); baseConsoleLog = sandbox.stub(Base, 'consoleLog'); }); it('should let you stub out console.log without effecting reporters output', function() { Base.list([]); - baseConsoleLog.restore(); expect(baseConsoleLog, 'was called'); expect(console.log, 'was not called'); + sandbox.restore(); }); + }); + + describe('epilogue', function() { + it('should include "pending" count', function() { + var ctx = {stats: {passes: 0, pending: 2, skipped: 0, duration: 12}}; + var epilogue = Base.prototype.epilogue.bind(ctx); - afterEach(function() { + epilogue(); sandbox.restore(); + + var out = stdout.join('\n').trim(); + expect(out, 'to contain', '2 pending').and('not to contain', 'skipped'); + }); + + it('should include "skipped" count', function() { + var ctx = {stats: {passes: 0, pending: 0, skipped: 3, duration: 12}}; + var epilogue = Base.prototype.epilogue.bind(ctx); + + epilogue(); + sandbox.restore(); + + var out = stdout.join('\n').trim(); + expect(out, 'to contain', '3 skipped').and('not to contain', 'pending'); }); }); });