diff --git a/index.js b/index.js index ed5c4bc..bce8dd2 100644 --- a/index.js +++ b/index.js @@ -62,7 +62,7 @@ function parse(str) { if (!obj.host && (/^git@/).test(str) === true) { // return the correct host for git@ URLs - obj.host = url.parse('http://' + str).host; + obj.host = url.parse('http://' + str.replace(/git@([^:]+):/, '$1/')).host; } obj.path = trimSlash(obj.path); diff --git a/test/index.js b/test/index.js index 40ae101..88757ee 100644 --- a/test/index.js +++ b/test/index.js @@ -5,6 +5,10 @@ var test = require('tape'); var gh = require('../'); test('parse-github-url', function (t) { + process.on('warning', function (e) { + t.fail(e, 'no deprecation warnings are issued'); + }); + t.equal(gh('toString').href, 'toString'); t.test('gets the user:', function (assert) {