UNPKG

@aller/blink

Version:

A library for tracking user behaviour.

18 lines 974 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var get_hostname_from_url_1 = __importDefault(require("../get-hostname-from-url")); describe('getHostnameFromUrl', function () { it('should get hostname from normal db url', function () { expect(get_hostname_from_url_1.default('https://www.dagbladet.no/a/8912312', 'test.no')).toBe('dagbladet.no'); }); it('should use hostname fallback', function () { expect(get_hostname_from_url_1.default('', 'dagbladet.no')).toBe('dagbladet.no'); }); it('should get hostname from normal db url without query-parameters', function () { expect(get_hostname_from_url_1.default('https://www.dagbladet.no/a/8912312?query-param=12', 'test.no')).toBe('dagbladet.no'); }); }); //# sourceMappingURL=get-hostname-from-url.test.js.map