Skip to content

Commit

Permalink
Fix quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
RodriAndreotti committed Mar 28, 2024
1 parent 3ce91b7 commit 4ef53e1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 40 deletions.
10 changes: 5 additions & 5 deletions test/e2e/cep-promise.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('[e2e] cep-promise', () => {
nock.enableNetConnect()
})

describe('when invoked with a valid '05010000' string', () => {
describe('when invoked with a valid "05010000" string', () => {
it('should fulfill with correct address', () =>
cep('05010000').then((address) => {
expect(address).to.deep.equal({
Expand Down Expand Up @@ -47,8 +47,8 @@ describe('[e2e] cep-promise', () => {
})
})

describe('when invoked with an inexistent '99999999' CEP', () => {
it('should reject with 'service_error'', () => {
describe('when invoked with an inexistent "99999999" CEP', () => {
it('should reject with "service_error"', () => {
return cep('99999999').catch((error) => {
return expect(error)
.to.be.an.instanceOf(CepPromiseError)
Expand Down Expand Up @@ -87,8 +87,8 @@ describe('[e2e] cep-promise', () => {
})
})

describe('when invoked with an invalid '123456789' CEP', () => {
it('should reject with 'validation_error'', () => {
describe('when invoked with an invalid "123456789" CEP', () => {
it('should reject with "validation_error"', () => {
return cep('123456789').catch((error) => {
return expect(error)
.to.be.an.instanceOf(CepPromiseError)
Expand Down
20 changes: 10 additions & 10 deletions test/unit/cep-promise-browser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('[unit] cep-promise for browser', () => {
})

describe('when invoked without arguments', () => {
it('should reject with 'validation_error'', () => {
it('should reject with "validation_error"', () => {
return cep().catch((error) => {
return expect(error)
.to.be.an.instanceOf(CepPromiseError)
Expand All @@ -78,7 +78,7 @@ describe('[unit] cep-promise for browser', () => {
})

describe('when invoked with an Array', () => {
it('should reject with 'validation_error'', () => {
it('should reject with "validation_error"', () => {
return cep([1, 2, 3]).catch((error) => {
return expect(error)
.to.be.an.instanceOf(CepPromiseError)
Expand All @@ -99,7 +99,7 @@ describe('[unit] cep-promise for browser', () => {
})

describe('when invoked with an Object', () => {
it('should reject with 'validation_error'', () => {
it('should reject with "validation_error"', () => {
return cep({ nintendo: true, ps: false, xbox: false }).catch((error) => {
return expect(error)
.to.be.an.instanceOf(CepPromiseError)
Expand All @@ -120,7 +120,7 @@ describe('[unit] cep-promise for browser', () => {
})

describe('when invoked with an Function', () => {
it('should reject with 'validation_error'', () => {
it('should reject with "validation_error"', () => {
return cep(function zelda() {
return 'link'
}).catch((error) => {
Expand All @@ -142,7 +142,7 @@ describe('[unit] cep-promise for browser', () => {
})
})

describe('when invoked with a valid '05010000' String', () => {
describe('when invoked with a valid "05010000" String', () => {
it('should fulfill with correct address', () => {
nock('https://viacep.com.br')
.get('/ws/05010000/json/')
Expand Down Expand Up @@ -322,8 +322,8 @@ describe('[unit] cep-promise for browser', () => {
})
})

describe('when invoked with an inexistent '99999999' CEP', () => {
it('should reject with 'service_error'', () => {
describe('when invoked with an inexistent "99999999" CEP', () => {
it('should reject with "service_error"', () => {
nock('https://viacep.com.br')
.get('/ws/99999999/json/')
.replyWithFile(
Expand Down Expand Up @@ -377,8 +377,8 @@ describe('[unit] cep-promise for browser', () => {
})
})

describe('when invoked with an invalid '123456789' CEP', () => {
it('should reject with 'validation_error'', () => {
describe('when invoked with an invalid "123456789" CEP', () => {
it('should reject with "validation_error"', () => {
return cep('123456789').catch((error) => {
return expect(error)
.to.be.an.instanceOf(CepPromiseError)
Expand All @@ -398,7 +398,7 @@ describe('[unit] cep-promise for browser', () => {
})

describe('when http request fails both for all services with bad response', () => {
it('should reject with 'service_error'', () => {
it('should reject with "service_error"', () => {
nock('https://viacep.com.br')
.get('/ws/05010000/json/')
.reply(400, '<h2>Bad Request (400)</h2>')
Expand Down
24 changes: 12 additions & 12 deletions test/unit/cep-promise-node.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('[unit] cep-promise for node', () => {
})

describe('when invoked without arguments', () => {
it('should reject with 'validation_error'', () => {
it('should reject with "validation_error"', () => {
return cep().catch((error) => {
return expect(error)
.to.be.an.instanceOf(CepPromiseError)
Expand All @@ -96,7 +96,7 @@ describe('[unit] cep-promise for node', () => {
})

describe('when invoked with an Array', () => {
it('should reject with 'validation_error'', () => {
it('should reject with "validation_error"', () => {
return cep([1, 2, 3]).catch((error) => {
return expect(error)
.to.be.an.instanceOf(CepPromiseError)
Expand All @@ -117,7 +117,7 @@ describe('[unit] cep-promise for node', () => {
})

describe('when invoked with an Object', () => {
it('should reject with 'validation_error'', () => {
it('should reject with "validation_error"', () => {
return cep({ nintendo: true, ps: false, xbox: false }).catch((error) => {
return expect(error)
.to.be.an.instanceOf(CepPromiseError)
Expand All @@ -138,7 +138,7 @@ describe('[unit] cep-promise for node', () => {
})

describe('when invoked with an Function', () => {
it('should reject with 'validation_error'', () => {
it('should reject with "validation_error"', () => {
return cep(function zelda() {
return 'link'
}).catch((error) => {
Expand All @@ -160,7 +160,7 @@ describe('[unit] cep-promise for node', () => {
})
})

describe('when invoked with a valid '05010000' String', () => {
describe('when invoked with a valid "05010000" String', () => {
it('should fulfill with correct address', () => {
nock('https://apps.correios.com.br')
.post('/SigepMasterJPA/AtendeClienteService/AtendeCliente')
Expand Down Expand Up @@ -617,8 +617,8 @@ describe('[unit] cep-promise for node', () => {
})
})

describe('when invoked with an inexistent '99999999' CEP', () => {
it('should reject with 'service_error'', () => {
describe('when invoked with an inexistent "99999999" CEP', () => {
it('should reject with "service_error"', () => {
nock('https://apps.correios.com.br')
.post('/SigepMasterJPA/AtendeClienteService/AtendeCliente')
.replyWithFile(
Expand Down Expand Up @@ -695,8 +695,8 @@ describe('[unit] cep-promise for node', () => {
})
})

describe('when invoked with an invalid '123456789' CEP', () => {
it('should reject with 'validation_error'', () => {
describe('when invoked with an invalid "123456789" CEP', () => {
it('should reject with "validation_error"', () => {
return cep('123456789').catch((error) => {
return expect(error)
.to.be.an.instanceOf(CepPromiseError)
Expand All @@ -716,7 +716,7 @@ describe('[unit] cep-promise for node', () => {
})

describe('when http request fails both for primary and secondary service with bad response', () => {
it('should reject with 'service_error'', () => {
it('should reject with "service_error"', () => {
nock('https://apps.correios.com.br')
.post('/SigepMasterJPA/AtendeClienteService/AtendeCliente')
.replyWithError(
Expand Down Expand Up @@ -775,7 +775,7 @@ describe('[unit] cep-promise for node', () => {
})

describe('when http request has unformatted xml and alternatives services fails', () => {
it('should reject with 'service_error'', () => {
it('should reject with "service_error"', () => {
nock('https://apps.correios.com.br')
.post('/SigepMasterJPA/AtendeClienteService/AtendeCliente')
.replyWithFile(
Expand Down Expand Up @@ -835,7 +835,7 @@ describe('[unit] cep-promise for node', () => {
})

describe('when http request fails both for primary and secondary service with error', () => {
it('should reject with 'service_error'', () => {
it('should reject with "service_error"', () => {
nock('https://apps.correios.com.br')
.post('/SigepMasterJPA/AtendeClienteService/AtendeCliente')
.replyWithError(
Expand Down
24 changes: 12 additions & 12 deletions test/unit/cep-promise-providers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('when invoked with providers parameter', () => {
})

describe('and the providers param is a string', () => {
it('should reject with 'validation_error'', () => {
it('should reject with "validation_error"', () => {
return cep('05010000', { providers: 'viacep' }).catch((error) => {
return expect(error)
.to.be.an.instanceOf(CepPromiseError)
Expand All @@ -39,7 +39,7 @@ describe('when invoked with providers parameter', () => {
})

describe('and the providers param is a integer', () => {
it('should reject with 'validation_error'', () => {
it('should reject with "validation_error"', () => {
return cep('05010000', { providers: 123 }).catch((error) => {
return expect(error)
.to.be.an.instanceOf(CepPromiseError)
Expand All @@ -59,7 +59,7 @@ describe('when invoked with providers parameter', () => {
})

describe('and the providers param is a object', () => {
it('should reject with 'validation_error'', () => {
it('should reject with "validation_error"', () => {
return cep('05010000', { providers: {} }).catch((error) => {
return expect(error)
.to.be.an.instanceOf(CepPromiseError)
Expand All @@ -79,7 +79,7 @@ describe('when invoked with providers parameter', () => {
})

describe('and the providers param is a function', () => {
it('should reject with 'validation_error'', () => {
it('should reject with "validation_error"', () => {
return cep('05010000', { providers: () => () => {} }).catch((error) => {
return expect(error)
.to.be.an.instanceOf(CepPromiseError)
Expand All @@ -99,7 +99,7 @@ describe('when invoked with providers parameter', () => {
})

describe('and the providers param is a invalid array', () => {
it('should reject with 'validation_error'', () => {
it('should reject with "validation_error"', () => {
const availableProviders = Object.keys(getAvailableServices())

return cep('05010000', { providers: [123, 'viacep'] }).catch((error) => {
Expand All @@ -121,7 +121,7 @@ describe('when invoked with providers parameter', () => {
})
})

describe('and the providers param is ['viacep']', () => {
describe('and the providers param is ["viacep"]', () => {
it('should call only viacep service', () => {
const correiosMock = nock('https://apps.correios.com.br')
.post('/SigepMasterJPA/AtendeClienteService/AtendeCliente')
Expand Down Expand Up @@ -176,7 +176,7 @@ describe('when invoked with providers parameter', () => {
})
})

describe('and the providers param is ['postmon']', () => {
describe('and the providers param is ["postmon"]', () => {
it('should call only postmon service', () => {
const correiosMock = nock('https://apps.correios.com.br')
.post('/SigepMasterJPA/AtendeClienteService/AtendeCliente')
Expand Down Expand Up @@ -231,7 +231,7 @@ describe('when invoked with providers parameter', () => {
})
})

describe('and the providers param is ['widenet']', () => {
describe('and the providers param is ["widenet"]', () => {
it('should call only widenet service', () => {
const correiosMock = nock('https://apps.correios.com.br')
.post('/SigepMasterJPA/AtendeClienteService/AtendeCliente')
Expand Down Expand Up @@ -286,7 +286,7 @@ describe('when invoked with providers parameter', () => {
})
})

describe('and the providers param is ['correios']', () => {
describe('and the providers param is ["correios"]', () => {
it('should call only correios service', () => {
const correiosMock = nock('https://apps.correios.com.br')
.post('/SigepMasterJPA/AtendeClienteService/AtendeCliente')
Expand Down Expand Up @@ -341,7 +341,7 @@ describe('when invoked with providers parameter', () => {
})
})

describe('and the providers param is ['correios-alt']', () => {
describe('and the providers param is ["correios-alt"]', () => {
it('should call only correios alt service', () => {
const correiosMock = nock('https://apps.correios.com.br')
.post('/SigepMasterJPA/AtendeClienteService/AtendeCliente')
Expand Down Expand Up @@ -398,7 +398,7 @@ describe('when invoked with providers parameter', () => {
})
})

describe('and the providers param is ['brasilapi']', () => {
describe('and the providers param is ["brasilapi"]', () => {
it('should call only brasilapi service', () => {
const correiosMock = nock('https://apps.correios.com.br')
.post('/SigepMasterJPA/AtendeClienteService/AtendeCliente')
Expand Down Expand Up @@ -462,7 +462,7 @@ describe('when invoked with providers parameter', () => {
})
})

describe('and the providers param is ['correios, viacep']', () => {
describe('and the providers param is ["correios, viacep"]', () => {
it('should call only correios and viacep services', () => {
const correiosMock = nock('https://apps.correios.com.br')
.post('/SigepMasterJPA/AtendeClienteService/AtendeCliente')
Expand Down
2 changes: 1 addition & 1 deletion test/unit/cep-promise-timeout.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('when invoked with timeout parameter', () => {
})

describe('and the providers exceed the timeout', () => {
it('should reject with 'service_error'', () => {
it('should reject with "service_error"', () => {
nock('https://brasilapi.com.br/')
.get('/api/cep/v1/05010000')
.delay(3)
Expand Down

0 comments on commit 4ef53e1

Please sign in to comment.