From d2b5dd38bb756fcdae618ff24b390856564690d2 Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Sat, 11 Nov 2017 01:28:29 +0100 Subject: [PATCH] Add Node 9.x to Travis Locally tested that the tests pass with Node 9.0.0 and 9.1.0 Also modified a test expectation for Node 9.0.0+ --- .travis.yml | 1 + test/test.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4aa28c5..f4d6c76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ node_js: - 6 - 7 - 8 + - 9 script: - npm run lint - npm run test diff --git a/test/test.js b/test/test.js index 4c7bcd9..d2885e5 100644 --- a/test/test.js +++ b/test/test.js @@ -392,10 +392,14 @@ describe('Proxy errors', function() { }); it('Invalid HTTP status code', function(done) { + var errorMessage = 'RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: 0'; + if (parseInt(process.versions.node, 10) < 9) { + errorMessage = 'RangeError: Invalid status code: 0'; + } request(cors_anywhere) .get('/' + bad_status_http_server_url) .expect('Access-Control-Allow-Origin', '*') - .expect(404, 'Not found because of proxy error: RangeError: Invalid status code: 0', done); + .expect(404, 'Not found because of proxy error: ' + errorMessage, done); }); it('Content-Encoding invalid body', function(done) {