Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
710 bytes
|
Line | |
---|
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 | }); |
---|
Note:
See
TracBrowser
for help on using the repository browser.