Skip to content

Commit

Permalink
update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmunechika committed Dec 9, 2021
1 parent 31955ad commit 54e7548
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/config/test/unit/index_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('src/index', () => {
'baseUrl': 'https://',
}, errorFn)

expect(errorFn).to.have.been.callCount(0)
expect(errorFn).to.have.callCount(0)
})

it('calls error callback if config is invalid', () => {
Expand Down Expand Up @@ -125,7 +125,7 @@ describe('src/index', () => {
configFile: 'config.js',
})

expect(errorFn).to.have.been.callCount(0)
expect(errorFn).to.have.callCount(0)
})

it('calls error callback if config contains breaking option that should throw an error', () => {
Expand Down Expand Up @@ -154,22 +154,23 @@ describe('src/index', () => {
configUtil.validateNoReadOnlyConfig({ chromeWebSecurity: false }, errorFn)

expect(errorFn).to.have.callCount(1)
expect(errorFn).to.have.been.calledWithMatch(/chromeWebSecurity/)
})

it('does not return an error if validation succeeds', () => {
const errorFn = sinon.spy()

configUtil.validateNoReadOnlyConfig({ requestTimeout: 1000 }, errorFn)

expect(errorFn).to.been.callCount(0)
expect(errorFn).to.have.callCount(0)
})

it('does not return an error if configuration is a non-Cypress config option', () => {
const errorFn = sinon.spy()

configUtil.validateNoReadOnlyConfig({ foo: 'bar' }, errorFn)

expect(errorFn).to.been.callCount(0)
expect(errorFn).to.have.callCount(0)
})
})
})

0 comments on commit 54e7548

Please sign in to comment.