Skip to content

Commit a85e55f

Browse files
committed
more tests
1 parent 8a2a6eb commit a85e55f

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

test/reporters/base.spec.js

+22-4
Original file line numberDiff line numberDiff line change
@@ -426,25 +426,43 @@ describe('Base reporter', function() {
426426
});
427427

428428
describe('when reporter output immune to user test changes', function() {
429-
var sandbox;
430429
var baseConsoleLog;
431430

432431
beforeEach(function() {
433-
sandbox = sinon.createSandbox();
434432
sandbox.stub(console, 'log');
435433
baseConsoleLog = sandbox.stub(Base, 'consoleLog');
436434
});
437435

438436
it('should let you stub out console.log without effecting reporters output', function() {
439437
Base.list([]);
440-
baseConsoleLog.restore();
441438

442439
expect(baseConsoleLog, 'was called');
443440
expect(console.log, 'was not called');
441+
sandbox.restore();
444442
});
443+
});
444+
445+
describe('epilogue', function() {
446+
it('should include "pending" count', function() {
447+
var ctx = {stats: {passes: 0, pending: 2, skipped: 0, duration: 12}};
448+
var epilogue = Base.prototype.epilogue.bind(ctx);
445449

446-
afterEach(function() {
450+
epilogue();
447451
sandbox.restore();
452+
453+
var out = stdout.join('\n').trim();
454+
expect(out, 'to contain', '2 pending').and('not to contain', 'skipped');
455+
});
456+
457+
it('should include "skipped" count', function() {
458+
var ctx = {stats: {passes: 0, pending: 0, skipped: 3, duration: 12}};
459+
var epilogue = Base.prototype.epilogue.bind(ctx);
460+
461+
epilogue();
462+
sandbox.restore();
463+
464+
var out = stdout.join('\n').trim();
465+
expect(out, 'to contain', '3 skipped').and('not to contain', 'pending');
448466
});
449467
});
450468
});

0 commit comments

Comments
 (0)