Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
queicherius committed Mar 16, 2017
1 parent 19a8166 commit 7798863
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .babelrc
@@ -1,5 +1,8 @@
{
"presets": ["latest", "stage-0"],
"presets": [
["env", {"targets": {"browsers": ["last 2 versions", "> 5%"], "node": 6}, "loose": true}],
"stage-0"
],
"env": {
"test": {
"plugins": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -19,7 +19,7 @@
"promise-control-flow": "^1.2.3"
},
"devDependencies": {
"abc-environment": "^1.0.5",
"abc-environment": "^2.0.0",
"fetch-mock": "^5.5.0"
}
}
12 changes: 6 additions & 6 deletions tests/index.spec.js
Expand Up @@ -43,7 +43,7 @@ describe('requesting', () => {
let content = await module.single('http://test.com/test', {type: 'response'})
expect(content.url).to.equal('http://test.com/test')
expect(content.status).to.equal(200)
expect(content.headers).to.exist
expect(content.headers).to.not.equal(undefined)
})

it('requests multiple urls as json', async () => {
Expand Down Expand Up @@ -94,14 +94,14 @@ describe('requesting', () => {
], {type: 'response'})
expect(content[0].url).to.equal('http://test.com/test')
expect(content[0].status).to.equal(200)
expect(content[0].headers).to.exist
expect(content[0].headers).to.not.equal(undefined)
})
})

describe('waiting', () => {
it('uses parallel calls if no wait time is specified', async () => {
mockResponses([
['^http', () => ({time: new Date().getTime()})]
['begin:http', () => ({time: new Date().getTime()})]
])

let timestamps = await module.many(['http://1.com', 'http://2.com', 'http://3.com'])
Expand All @@ -113,7 +113,7 @@ describe('waiting', () => {

it('uses sequential calls and waits if a wait time is specified', async () => {
mockResponses([
['^http', () => ({time: new Date().getTime()})]
['begin:http', () => ({time: new Date().getTime()})]
])

let timestamps = await module.many(
Expand Down Expand Up @@ -249,7 +249,7 @@ describe('error handling', () => {
}

expect(err).to.exist.and.be.instanceof(Error)
expect(err.response).to.be.an.object
expect(typeof err.response).to.equal('object')
expect(err.message).to.equal('Status 403')
expect(err.response.status).to.equal(403)
expect(err.content).to.deep.equal({text: 'authentication required'})
Expand Down Expand Up @@ -327,7 +327,7 @@ describe('retrying', () => {
let deciderArguments = callback.args[0]
expect(deciderArguments[0]).to.equal(2)
expect(deciderArguments[1]).to.exist.and.be.instanceof(Error)
expect(deciderArguments[1].response).to.exist
expect(deciderArguments[1].response).to.not.equal(undefined)
expect(deciderArguments[1].response.status).to.equal(500)
})

Expand Down

0 comments on commit 7798863

Please sign in to comment.