@gibraltarsoftware/loupe-typescript
Version:
Loupe Agent for Web clients
21 lines • 947 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var loupe_agent_1 = require("../loupe.agent");
jest.useFakeTimers();
describe('Testing Loupe Agent', function () {
test('agent can be created', function () {
var loupe = new loupe_agent_1.LoupeAgent();
expect(loupe).not.toBe(null);
});
test('throws if no origin is set', function () {
var loupe = new loupe_agent_1.LoupeAgent();
expect(function () { return loupe.verbose('Javascript', 'verbose caption', 'verbose description'); }).toThrow(Error);
});
test('does not throw if origin is set', function () {
var loupe = new loupe_agent_1.LoupeAgent();
loupe.setLogServer('http://localhost:8081');
jest.runAllTimers();
expect(function () { return loupe.verbose('Javascript', 'verbose caption', 'verbose description'); }).not.toThrow(Error);
});
});
//# sourceMappingURL=test.spec.js.map