File tree Expand file tree Collapse file tree 4 files changed +28
-2
lines changed
Expand file tree Collapse file tree 4 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,15 @@ before_install:
3232 elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then
3333 npm install --save-dev mocha@3.5.3
3434 fi
35+ - |
36+ # supertest for http calls
37+ # - use 1.1.0 for Node.js < 0.10
38+ # - use 2.0.0 for Node.js < 4
39+ if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -eq 0 && "$(cut -d. -f2 <<< "$TRAVIS_NODE_VERSION")" -lt 10 ]]; then
40+ npm install --save-dev supertest@1.1.0
41+ elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 4 ]]; then
42+ npm install --save-dev supertest@2.0.0
43+ fi
3544 - |
3645 # istanbul for coverage
3746 # - remove for Node.js < 0.10
Original file line number Diff line number Diff line change @@ -46,6 +46,15 @@ install:
4646 } elseif ([int]$env:nodejs_version.split(".")[0] -lt 6) {
4747 npm install --silent --save-dev mocha@3.5.3
4848 }
49+ - ps : |
50+ # supertest for http calls
51+ # - use 1.1.0 for Node.js < 0.10
52+ # - use 2.0.0 for Node.js < 4
53+ if ([int]$env:nodejs_version.split(".")[0] -eq 0 -and [int]$env:nodejs_version.split(".")[1] -lt 10) {
54+ npm install --silent --save-dev supertest@1.1.0
55+ } elseif ([int]$env:nodejs_version.split(".")[0] -lt 4) {
56+ npm install --silent --save-dev supertest@2.0.0
57+ }
4958 # Update Node.js modules
5059 - ps : |
5160 # Prune & rebuild node_modules
Original file line number Diff line number Diff line change 4141 "eslint-plugin-standard" : " 3.1.0" ,
4242 "istanbul" : " 0.4.5" ,
4343 "mocha" : " 5.2.0" ,
44- "supertest" : " 1.1 .0"
44+ "supertest" : " 3.3 .0"
4545 },
4646 "files" : [
4747 " HISTORY.md" ,
Original file line number Diff line number Diff line change @@ -85,8 +85,10 @@ describe('send(file).pipe(res)', function () {
8585 it ( 'should support HEAD' , function ( done ) {
8686 request ( app )
8787 . head ( '/name.txt' )
88+ . expect ( 200 )
8889 . expect ( 'Content-Length' , '4' )
89- . expect ( 200 , '' , done )
90+ . expect ( shouldNotHaveBody ( ) )
91+ . end ( done )
9092 } )
9193
9294 it ( 'should add an ETag header field' , function ( done ) {
@@ -1464,6 +1466,12 @@ function createServer (opts, fn) {
14641466 } )
14651467}
14661468
1469+ function shouldNotHaveBody ( ) {
1470+ return function ( res ) {
1471+ assert . ok ( res . text === '' || res . text === undefined )
1472+ }
1473+ }
1474+
14671475function shouldNotHaveHeader ( header ) {
14681476 return function ( res ) {
14691477 assert . ok ( ! ( header . toLowerCase ( ) in res . headers ) , 'should not have header ' + header )
You can’t perform that action at this time.
0 commit comments