From d3c8cd2cc9e72e970de0e66fdbd92c3a032dfe1a Mon Sep 17 00:00:00 2001 From: Kurtis Rainbolt-Greene Date: Tue, 10 Jan 2017 11:43:27 -0800 Subject: [PATCH] All of these are valid URLs according to https://www.w3.org/Addressing/URL/url-spec.html#z22 --- test/index.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/test/index.js b/test/index.js index 5f7aebc..ba446c2 100644 --- a/test/index.js +++ b/test/index.js @@ -96,6 +96,22 @@ describe('is-url', function () { it('//google.com', function () { assert(url('//google.com')); }); + + it('http://google', function () { + assert(url('http://google')); + }); + + it('http://google:3000', function () { + assert(url('http://google:3000')); + }); + + it('http://google:3000/x', function () { + assert(url('http://google:3000/x')); + }); + + it('http://google/x', function () { + assert(url('http://google/x')); + }); }); describe('invalid', function () { @@ -103,10 +119,6 @@ describe('is-url', function () { assert(!url('http://')); }); - it('http://google', function () { - assert(!url('http://google')); - }); - it('http://google.', function () { assert(!url('http://google.')); });