Permalink
Browse files

build: supertest@3.1.0

  • Loading branch information...
dougwilson committed Sep 15, 2018
1 parent c3f2d40 commit f1646466ac359cd385590994195d53f575855164
Showing with 19 additions and 3 deletions.
  1. +6 −0 .travis.yml
  2. +1 −1 package.json
  3. +12 −2 test/server.js
View
@@ -34,6 +34,12 @@ before_install:
if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 4 ]]; then
npm install --save-dev nyc@10.3.2
fi
- |
# supertest for http calls
# - use 2.0.0 for Node.js < 4
if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 4 ]]; then
npm install --save-dev supertest@2.0.0
fi
# Update Node.js modules
- |
# Prune & rebuild node_modules
View
@@ -26,7 +26,7 @@
"eslint": "2.13.1",
"mocha": "5.2.0",
"nyc": "11.9.0",
"supertest": "2.0.0"
"supertest": "3.1.0"
},
"license": "MIT",
"files": [
View
@@ -154,7 +154,9 @@ describe('app', function(){
request(app)
.head('/')
.expect(404, '', done);
.expect(404)
.expect(shouldHaveNoBody())
.end(done)
})
})
@@ -223,7 +225,15 @@ describe('app', function(){
request(app)
.head('/')
.expect(500, '', done);
.expect(500)
.expect(shouldHaveNoBody())
.end(done)
});
});
});
function shouldHaveNoBody () {
return function (res) {
assert.ok(res.text === '' || res.text === undefined)
}
}

0 comments on commit f164646

Please sign in to comment.