build: supertest@3.4.2
This commit is contained in:
@@ -51,8 +51,11 @@ before_install:
|
||||
- |
|
||||
# supertest for testing
|
||||
# - use 1.1.0 for Node.js < 0.10
|
||||
# - use 2.0.0 for Node.js < 4
|
||||
if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -eq 0 && "$(cut -d. -f2 <<< "$TRAVIS_NODE_VERSION")" -lt 10 ]]; then
|
||||
npm install --save-dev supertest@1.1.0
|
||||
elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 4 ]]; then
|
||||
npm install --save-dev supertest@2.0.0
|
||||
fi
|
||||
# Update Node.js modules
|
||||
- |
|
||||
|
||||
@@ -51,9 +51,11 @@ install:
|
||||
- ps: |
|
||||
# mocha for testing
|
||||
# - use 1.1.0 for Node.js < 0.10
|
||||
# - use 3.x for Node.js < 4
|
||||
# - use 2.0.0 for Node.js < 4
|
||||
if ([int]$env:nodejs_version.split(".")[0] -eq 0 -and [int]$env:nodejs_version.split(".")[1] -lt 10) {
|
||||
npm install --silent --save-dev supertest@1.1.0
|
||||
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 4) {
|
||||
npm install --silent --save-dev supertest@2.0.0
|
||||
}
|
||||
# Update Node.js modules
|
||||
- ps: |
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"eslint-plugin-markdown": "1.0.0",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "4.1.0",
|
||||
"supertest": "2.0.0"
|
||||
"supertest": "3.4.2"
|
||||
},
|
||||
"files": [
|
||||
"public/",
|
||||
|
||||
10
test/test.js
10
test/test.js
@@ -48,7 +48,9 @@ describe('serveIndex(root)', function () {
|
||||
|
||||
request(server)
|
||||
.head('/')
|
||||
.expect(200, '', done)
|
||||
.expect(200)
|
||||
.expect(shouldNotHaveBody())
|
||||
.end(done)
|
||||
})
|
||||
|
||||
it('should work with OPTIONS requests', function (done) {
|
||||
@@ -843,3 +845,9 @@ function bodyDoesNotContain(text) {
|
||||
assert.equal(res.text.indexOf(text), -1)
|
||||
}
|
||||
}
|
||||
|
||||
function shouldNotHaveBody () {
|
||||
return function (res) {
|
||||
assert.ok(res.text === '' || res.text === undefined)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user