Skip to content

Commit

Permalink
Fix travis-CI scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sogaani committed Aug 1, 2018
1 parent e4afd79 commit 8ce1a61
Show file tree
Hide file tree
Showing 8 changed files with 2,307 additions and 12 deletions.
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ before_install:
# Setup Node.js version-specific dependencies
- "test $TRAVIS_NODE_VERSION != '0.8' || npm rm --save-dev istanbul"
- "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 4 || npm rm --save-dev eslint"
- "test -z $(echo $HTTP2_TEST) || npm install --only=dev https://github.com/sogaani/express.git#initial-support-http2 https://github.com/sogaani/supertest.git#http2"
# Update Node.js modules
- "test ! -d node_modules || npm prune"
- "test ! -d node_modules || npm rebuild"
Expand All @@ -27,9 +28,11 @@ script:
- "test ! -z $(npm -ps ls istanbul) || npm test"
- "test -z $(npm -ps ls istanbul) || npm run-script test-ci"
- "test -z $(npm -ps ls eslint) || npm run-script lint"
# Run test script with http2
- "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 8 || npm install https://github.com/sogaani/express.git#initial-support-http2 https://github.com/sogaani/supertest.git#http2"
- "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 8 || npm test-http2"
- "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 8 || npm run-script test-http2-ci"
after_script:
- "test -e ./coverage/lcov.info && npm install coveralls@2 && cat ./coverage/lcov.info | coveralls"
matrix:
include:
- node_js: "8.11"
env: HTTP2_TEST=1
- node_js: "10.7"
env: HTTP2_TEST=1
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Cookies.prototype.set = function(name, value, opts) {
headers = pushCookie(headers, cookie)
}

var protoSetHeader = http2 && res instanceof http2.Http2ServerResponse ?
var protoSetHeader = http2 && res instanceof http2.Http2ServerResponse ?
http2.Http2ServerResponse.prototype.setHeader : http.OutgoingMessage.prototype.setHeader;
var setHeader = res.set ? protoSetHeader : res.setHeader
setHeader.call(res, 'Set-Cookie', headers)
Expand Down
Loading

0 comments on commit 8ce1a61

Please sign in to comment.