Projekt

Obecné

Profil

Stáhnout (793 Bajtů) Statistiky
| Větev: | Revize:
1
"use strict";
2

    
3
describe("loglevel included via node", function () {
4
    it("is included successfully", function () {
5
        expect(require('../lib/loglevel')).not.toBeUndefined();
6
    });
7

    
8
    it("allows setting the logging level", function () {
9
        var log = require('../lib/loglevel');
10

    
11
        log.setLevel(log.levels.TRACE);
12
        log.setLevel(log.levels.DEBUG);
13
        log.setLevel(log.levels.INFO);
14
        log.setLevel(log.levels.WARN);
15
        log.setLevel(log.levels.ERROR);
16
    });
17

    
18
    it("successfully logs", function () {
19
        var log = require('../lib/loglevel');
20
        console.info = jasmine.createSpy("info");
21

    
22
        log.setLevel(log.levels.INFO);
23
        log.info("test message");
24

    
25
        expect(console.info).toHaveBeenCalledWith("test message");
26
    });
27
});
(14-14/19)