Projekt

Obecné

Profil

Stáhnout (710 Bajtů) Statistiky
| Větev: | Revize:
1
/* global log */
2
"use strict";
3

    
4
describe("loglevel from a global <script> tag", function () {
5
    it("is available globally", function () {
6
        expect(log).not.toBeUndefined();
7
    });
8

    
9
    it("allows setting the logging level", function () {
10
        log.setLevel(log.levels.TRACE);
11
        log.setLevel(log.levels.DEBUG);
12
        log.setLevel(log.levels.INFO);
13
        log.setLevel(log.levels.WARN);
14
        log.setLevel(log.levels.ERROR);
15
    });
16

    
17
    it("successfully logs", function () {
18
        window.console = { "log": jasmine.createSpy("log") };
19

    
20
        log.setLevel(log.levels.INFO);
21
        log.info("test message");
22

    
23
        expect(console.log).toHaveBeenCalledWith("test message");
24
    });
25
});
(7-7/19)