@platform/cell.schema
Version:
URI and database schemas for the `cell.os`.
35 lines (34 loc) • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var test_1 = require("../test");
var util = require("./util");
describe('Url: util', function () {
describe('toProtocol', function () {
it('https', function () {
var test = function (input) {
(0, test_1.expect)(util.toProtocol(input)).to.eql('https');
};
test('');
test(' ');
test('domain.com');
test(' domain.com ');
test('localhost.com');
});
it('localhost => http', function () {
var test = function (input) {
(0, test_1.expect)(util.toProtocol(input)).to.eql('http');
};
test('localhost');
test(' localhost ');
test('localhost:1234');
test(' localhost:1234 ');
});
it('192.168.x.x => http (internal IP)', function () {
var test = function (input) {
(0, test_1.expect)(util.toProtocol(input)).to.eql('http');
};
test('192.168.1.1');
test(' 192.168.255.255 ');
});
});
});