kibana-with-account
Version:
kibana-with-account is develop based kibana project
38 lines (32 loc) • 813 B
JavaScript
var expect = require('expect.js');
var getUrl = require('../getUrl');
describe('getUrl', function () {
it('should convert to a url', function () {
var url = getUrl({
protocol: 'http',
hostname: 'localhost',
}, {
pathname: 'foo'
});
expect(url).to.be('http://localhost/foo');
});
it('should convert to a secure url with port', function () {
var url = getUrl({
protocol: 'http',
hostname: 'localhost',
port: 9220
}, {
pathname: 'foo'
});
expect(url).to.be('http://localhost:9220/foo');
});
it('should convert to a secure hashed url', function () {
expect(getUrl({
protocol: 'https',
hostname: 'localhost',
}, {
pathname: 'foo',
hash: 'bar'
})).to.be('https://localhost/foo#bar');
});
});