diff --git a/.gitignore b/.gitignore index e3c2c15428..567e515ef7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ node_modules /ssl/*.pem .idea/ .DS_Store +.nyc_output diff --git a/.travis.yml b/.travis.yml index 5c3c33ab3d..576d936681 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,59 @@ sudo: false + +git: + depth: 10 + branches: only: - master + - next + - v2 + +language: node_js + +cache: + directories: + - node_modules + - $HOME/.npm + +matrix: + fast_finish: true + include: + - env: JOB_PART=lint + node_js: 11 + - &linux + env: JOB_PART=test + node_js: 11 + - <<: *linux + node_js: 10 + - <<: *linux + node_js: 8 + - <<: *linux + node_js: 6 + - &osx + os: 'osx' + env: JOB_PART=test + node_js: 11 + - <<: *osx + node_js: 10 + - <<: *osx + node_js: 8 + - <<: *osx + node_js: 6 + +before_install: + - npm i -g npm@latest -language: - node_js +install: + - npm ci -node_js: - - '10' - - '8' - - '6' - - '4' +before_script: + - node --version + - npm --version script: - npm run ci + - npm run $JOB_PART after_success: - - cat ./coverage/coverage.json | node_modules/codecov.io/bin/codecov.io.js - - rm -rf ./coverage + - npm i codecov + - $(npm bin)/codecov diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000000..49699a3a9a --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,38 @@ +build: 'off' + +branches: + only: + - master + - next + - v2 + +init: + - git config --global core.autocrlf input + +cache: + - node_modules + - '%APPDATA%\npm-cache' + +environment: + matrix: + - nodejs_version: '11' + webpack_version: latest + - nodejs_version: '10' + webpack_version: latest + - nodejs_version: '8' + webpack_version: latest + - nodejs_version: '6' + webpack_version: latest + +matrix: + fast_finish: true + +install: + - ps: Install-Product node $env:nodejs_version x64 + - npm i -g npm@latest + - npm ci + +test_script: + - node --version + - npm --version + - cmd: npm test diff --git a/lib/Server.js b/lib/Server.js index 229843d044..4813bb8c4c 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -31,7 +31,7 @@ const optionsSchema = require('./optionsSchema.json'); // eslint-disable-next-line global-require const SockjsSession = require('sockjs/lib/transport').Session; const decorateConnection = SockjsSession.prototype.decorateConnection; - SockjsSession.prototype.decorateConnection = function(req) { + SockjsSession.prototype.decorateConnection = function (req) { decorateConnection.call(this, req); const connection = this.connection; if (connection.headers && !('origin' in connection.headers) && 'origin' in req.headers) {