-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(reporters): cannot read property map of undefined
Fixes #1662
- Loading branch information
1 parent
79bc193
commit 305df2c
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
describe('reporter', function () { | ||
var ProgressReporter = require('../../../lib/reporters/progress') | ||
|
||
describe('Progress', function () { | ||
var reporter | ||
var formatError | ||
|
||
beforeEach(function () { | ||
formatError = sinon.spy() | ||
reporter = new ProgressReporter(formatError, null, false, {terminal: true}) | ||
}) | ||
|
||
it('should turn off colors', function () { | ||
expect(reporter.EXCLUSIVELY_USE_COLORS).to.equal(false) | ||
}) | ||
|
||
it('should prepare state on run tests', function () { | ||
sinon.stub(reporter, 'write') | ||
sinon.stub(reporter, 'renderBrowser') | ||
|
||
reporter.onRunStart() | ||
reporter.onBrowserStart(createBrowserMock()) | ||
|
||
reporter.onRunStart() | ||
|
||
expect(reporter._browsers.length).to.equal(0) | ||
expect(reporter._isRendered).to.equal(false) | ||
}) | ||
|
||
it('should not throw exception if browser exit with error without run tests', function () { | ||
sinon.stub(reporter, 'write') | ||
sinon.stub(reporter, 'renderBrowser') | ||
|
||
expect(function () { | ||
reporter.onBrowserError(createBrowserMock()) | ||
}).to.not.throw() | ||
}) | ||
|
||
function createBrowserMock () { | ||
return {} | ||
} | ||
}) | ||
}) |