Skip to content

Commit

Permalink
Revert "Revert "Add unit test for status 0 flake callback""
Browse files Browse the repository at this point in the history
This reverts commit c8f5e55.
  • Loading branch information
NickTomlin committed Feb 5, 2019
1 parent 9357450 commit 8be0cd0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/unit/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ describe('Protractor Flake', () => {
spawnStub.endCallback(1)
})

it('calls callback with output from protractor process if the status is 0', (done) => {
protractorFlake({maxAttempts: 1}, (status: number, output: string) => {
expect(status).to.equal(status, 0)
expect(output).to.equal('Test')
done()
})

spawnStub.dataCallback('Test')
spawnStub.endCallback(0)
})

it('does not blow up if no callback is passed', function () {
protractorFlake({maxAttempts: 1})

Expand Down

0 comments on commit 8be0cd0

Please sign in to comment.