Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
  • Loading branch information
boneskull committed May 19, 2020
1 parent d307c31 commit e69edbe
Showing 1 changed file with 35 additions and 29 deletions.
64 changes: 35 additions & 29 deletions test/unit/runner.spec.js
Expand Up @@ -852,7 +852,7 @@ describe('Runner', function() {
]).and('was called once');
});

describe('when Runner has already started', function() {
describe('when Runner is RUNNING', function() {
beforeEach(function() {
runner.state = STATE_RUNNING;
});
Expand All @@ -869,39 +869,45 @@ describe('Runner', function() {
});
});

describe('when Runner not running', function() {
describe('when idle', function() {
beforeEach(function() {
runner.state = STATE_IDLE;
});
describe('when Runner is IDLE', function() {
beforeEach(function() {
runner.state = STATE_IDLE;
});

it('should emit start/end events for the benefit of reporters', function() {
expect(
function() {
runner.uncaught(err);
},
'to emit from',
runner,
'start'
).and('to emit from', runner, 'end');
});
it('should emit start/end events for the benefit of reporters', function() {
expect(
function() {
runner.uncaught(err);
},
'to emit from',
runner,
'start'
).and('to emit from', runner, 'end');
});
});

describe('when stopped', function() {
beforeEach(function() {
runner.state = STATE_STOPPED;
});
describe('when Runner is STOPPED', function() {
beforeEach(function() {
runner.state = STATE_STOPPED;
});

it('should emit start/end events for the benefit of reporters', function() {
expect(
function() {
it('should not emit start/end events, since this presumably would have already happened', function() {
expect(
function() {
try {
runner.uncaught(err);
},
'to emit from',
runner,
'start'
).and('to emit from', runner, 'end');
});
} catch (ignored) {}
},
'not to emit from',
runner,
'start'
).and('not to emit from', runner, 'end');
});

it('should throw', function() {
expect(function() {
runner.uncaught(err);
}, 'to throw');
});
});
});
Expand Down

0 comments on commit e69edbe

Please sign in to comment.