1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | const chai_1 = require("chai");
|
19 | const mock_logger_1 = require("./test/mock-logger");
|
20 | const logger_1 = require("./logger");
|
21 | describe('logger', () => {
|
22 | it('window is not defined', () => {
|
23 | (0, chai_1.expect)(() => { window; }).to.throw(ReferenceError, /window is not defined/);
|
24 | });
|
25 | it('window is not defined when converting to boolean', () => {
|
26 | (0, chai_1.expect)(() => { !!window; }).to.throw(ReferenceError, /window is not defined/);
|
27 | });
|
28 | it('window is not defined safe', () => {
|
29 | (0, chai_1.expect)(() => { typeof window !== 'undefined'; }).to.not.throw(ReferenceError);
|
30 | });
|
31 | it('setting the root logger should not throw an error when the window is not defined', () => {
|
32 | (0, chai_1.expect)(() => {
|
33 | try {
|
34 | (0, logger_1.setRootLogger)(new mock_logger_1.MockLogger());
|
35 | }
|
36 | finally {
|
37 | (0, logger_1.unsetRootLogger)();
|
38 | }
|
39 | }).to.not.throw(ReferenceError);
|
40 | });
|
41 | });
|
42 |
|
\ | No newline at end of file |