From c67f543f754f49875d0857b100dec7438b03d6c5 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Tue, 11 Sep 2018 21:06:38 +0800 Subject: [PATCH] test: make ci run faster (#1242) --- .travis.yml | 19 ++++++++----------- test/response/status.js | 4 ++-- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index d52322f..c4fde3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ +sudo: false language: node_js node_js: - - stable + - 10 + - 8 - 7 - 6 - 5 @@ -9,17 +11,12 @@ node_js: - 2 - 1 - 0.12 -matrix: - include: - - node_js: "8.0" - env: "NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly" - allow_failures: - # Allow the nightly installs to fail - - env: "NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly" +cache: + directories: + - wrk/bin before_script: - - sudo apt-get install build-essential libssl-dev git - - git clone https://github.com/wg/wrk.git - - cd wrk && make && sudo cp wrk /usr/local/bin && cd .. + - "[ ! -f wrk/bin/wrk ] && rm -rf wrk && git clone https://github.com/wg/wrk.git && make -C wrk && mkdir wrk/bin && mv wrk/wrk wrk/bin || true" + - export PATH=$PATH:$PWD/wrk/bin/ script: - make test-travis - make bench diff --git a/test/response/status.js b/test/response/status.js index 50abb58..33f5d05 100644 --- a/test/response/status.js +++ b/test/response/status.js @@ -28,7 +28,7 @@ describe('res.status=', function(){ it('should throw', function(){ assert.throws(function() { response().status = 999; - }, 'invalid status code: 999'); + }, /invalid status code: 999/); }) }) @@ -63,7 +63,7 @@ describe('res.status=', function(){ it('should throw', function(){ assert.throws(function() { response().status = 'forbidden'; - }, 'status code must be a number'); + }, /status code must be a number/); }) })