Skip to content

Commit

Permalink
Correct test for PERCY_ENABLED
Browse files Browse the repository at this point in the history
The previous test tested that PERCY_ENABLED _did not_ work. That is, it tested
that a warning was still thrown even though it was disabled.

That test has been corrected to assert that _nothing_ is thrown when disabled.
  • Loading branch information
wwilsman committed Aug 20, 2019
1 parent fbc11cd commit 7acb914
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/commands/percy-command.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ describe('percy-command', () => {
.stub(process, 'env', {PERCY_ENABLE: '0', PERCY_TOKEN: ''})
.stderr()
.command(['percy-command'])
.do((output) => expect(output.stderr).to.contain(
'Warning: Skipping visual tests. PERCY_TOKEN was not provided.',
))
.it('warns about PERCY_TOKEN to be set')
.do((output) => expect(output.stderr).to.eql(''))
.it('outputs no warnings when PERCY_ENABLED is 0')

test
.stub(process, 'env', {PERCY_ENABLE: '0', PERCY_TOKEN: 'ABC'})
.stub(process, 'env', {PERCY_TOKEN: 'ABC'})
.stderr()
.command(['percy-command'])
.do((output) => expect(output.stderr).to.eql(''))
.it('outputs no errors')
.it('outputs no errors when PERCY_TOKEN is set')
})

0 comments on commit 7acb914

Please sign in to comment.