Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test(browser): fix onInfo test case, add new test for total update
  • Loading branch information
matz3 committed Feb 13, 2019
commit 18eec879dab345cacac0e233d2c2908874448f4a
13 changes: 10 additions & 3 deletions test/unit/browser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,19 @@ describe('Browser', () => {
expect(spy).to.have.been.calledWith(browser, infoData)
})

it('should ignore if browser not executing', () => {
it('should update total specs count during execution', () => {
browser.state = Browser.STATE_EXECUTING
browser.onInfo({total: 20})

expect(browser.lastResult.total).to.equal(20)
})

it('should ignore update total if not executing', () => {
const spy = sinon.spy()
emitter.on('browser_dump', spy)
emitter.on('browser_log', spy)
emitter.on('browser_info', spy)

browser.state = Browser.STATE_CONNECTED
browser.onInfo({dump: 'something'})
browser.onInfo({total: 20})

expect(browser.lastResult.total).to.equal(0)
Expand Down