GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — original/test.js at master · unshiftio/original Expand file tree/ Copy pathtest.jsMore file actions 93 lines (67 loc) · 2.62 KB / Copy pathtest.jsFile metadata and controls93 lines (67 loc) · 2.62 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 describe('original', function () { 'use strict'; var assume = require('assume') , origin = require('./') , same = origin.same; it('is exposed as a function', function () { assume(origin).is.a('function'); }); it('also accepts objects instead of strings', function () { var o = origin(new URL('http://google.com:80/pathname')); assume(o).equals('http://google.com'); }); it('also accepts origins as origin', function () { var o = origin('http://google.com:80/pathname'); assume(origin(o)).equals(o); }); it('lowercases the origin', function () { var o = origin('hTtp://WwW.ExAMPLE.cOM:8080'); assume(o).equals('http://www.example.com:8080'); o = origin('https://www.EXAMPLE.com:8080'); assume(o).equals('https://www.example.com:8080'); o = origin('HTTPS://WWW.example.COM:8080'); assume(o).equals('https://www.example.com:8080'); }); it('returns `null` if the protocol is not specified', function () { var o = origin('www.example.com'); assume(o).equals('null'); }); it('returns `null` if the hostname is not specified', function () { var o = origin('http://'); assume(o).equals('null'); }); it("returns `null` if the protocol is `'file:'`", function () { var o = origin('file://google.com/pathname'); assume(o).equals('null'); }) it("removes the default port if the protocol is `'http:'`", function () { var o = origin('http://google.com:80/pathname'); assume(o).equals('http://google.com'); o = origin('http://google.com:80'); assume(o).equals('http://google.com'); o = origin('http://google.com'); assume(o).equals('http://google.com'); o = origin('https://google.com:443/pathname'); assume(o).equals('https://google.com'); o = origin('http://google.com:443/pathname'); assume(o).equals('http://google.com:443'); o = origin('https://google.com:80/pathname'); assume(o).equals('https://google.com:80'); }); it("removes the default port if the protocol is `'ws:'`", function () { var o = origin('ws://google.com:80/pathname'); assume(o).equals('ws://google.com'); o = origin('wss://google.com:443/pathname'); assume(o).equals('wss://google.com'); o = origin('ws://google.com:443/pathname'); assume(o).equals('ws://google.com:443'); o = origin('wss://google.com:80/pathname'); assume(o).equals('wss://google.com:80'); }); describe('.same', function () { assume(origin.same).is.a('function'); it('returns `true` if the origins are the same', function () { assume(same('http://google.com', 'http://google.com:80')).is.true(); }); }); }); |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |