diff --git a/.travis.yml b/.travis.yml index 22ebb02..0765106 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,16 @@ +sudo: false language: node_js node_js: + - "4" + - "iojs" - "0.12" - - "0.11" - "0.10" - - "0.9" - - "0.8" - - "iojs-v1.1" - - "iojs-v1.0" -before_install: - - "npm install -g npm@1.4.x" script: - "npm run test-travis" after_script: - - "npm install coveralls@2.11.x && cat coverage/lcov.info | coveralls" + - "npm install coveralls@2 && cat coverage/lcov.info | coveralls" matrix: fast_finish: true - allow_failures: - - node_js: "0.11" - - node_js: "0.9" - - node_js: "iojs-v1.1" - - node_js: "iojs-v1.0" notifications: irc: channels: diff --git a/index.js b/index.js index 9ecfae3..4f267b2 100644 --- a/index.js +++ b/index.js @@ -25,7 +25,7 @@ module.exports = function required(port, protocol) { return port !== 443; case 'ftp': - return port !== 22; + return port !== 21; case 'gopher': return port !== 70; diff --git a/package.json b/package.json index 4159070..2496c0a 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,10 @@ "main": "index.js", "scripts": { "100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100", - "test": "mocha test.js", + "test-travis": "istanbul cover _mocha --report lcovonly -- test.js", + "coverage": "istanbul cover _mocha -- test.js", "watch": "mocha --watch test.js", - "coverage": "istanbul cover ./node_modules/.bin/_mocha -- test.js", - "test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- test.js" + "test": "mocha test.js" }, "repository": { "type": "git", @@ -39,9 +39,9 @@ }, "homepage": "https://github.com/unshiftio/requires-port", "devDependencies": { - "assume": "1.1.x", - "istanbul": "0.3.x", - "mocha": "2.1.x", - "pre-commit": "1.0.x" + "assume": "1.3.x", + "istanbul": "0.4.x", + "mocha": "2.3.x", + "pre-commit": "1.1.x" } } diff --git a/test.js b/test.js index abd6bcb..93a0c74 100644 --- a/test.js +++ b/test.js @@ -72,11 +72,11 @@ describe('requires-port', function () { assume(required(8080, 'wss://www.google.com')).true(); }); - it('does not require port 22 for ftp', function () { - assume(required('22', 'ftp')).false(); - assume(required(22, 'ftp')).false(); - assume(required(22, 'ftp://')).false(); - assume(required(22, 'ftp://www.google.com')).false(); + it('does not require port 21 for ftp', function () { + assume(required('21', 'ftp')).false(); + assume(required(21, 'ftp')).false(); + assume(required(21, 'ftp://')).false(); + assume(required(21, 'ftp://www.google.com')).false(); assume(required('8080', 'ftp')).true(); assume(required(8080, 'ftp')).true();