source: trip-planner-front/node_modules/loglevel/test/test-qunit.js@ 6a3a178

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: 1.8 KB
Line 
1"use strict";
2
3/*global document*/
4var fixture = document.getElementById("qunit-fixture");
5
6/*global QUnit*/
7QUnit.module('loglevel', {
8 setup: function() {
9 },
10 teardown: function() {
11 }
12});
13
14/*global test*/
15test('basic test', function() {
16 /*global ok*/
17 /*global logging*/
18 /*global log*/
19
20 // Check that noConflict restored the original log
21 ok(typeof log === "function", "log is a function");
22 ok(log === QUnit.log, "log is Qunit.log");
23
24 // Check that noConflict setup logging
25 ok(typeof logging !== "undefined", "logging is defined");
26 ok(typeof logging === "object", "logging is an object");
27 ok(typeof logging.trace === "function", "trace is a function");
28 ok(typeof logging.debug === "function", "debug is a function");
29 ok(typeof logging.info === "function", "info is a function");
30 ok(typeof logging.warn === "function", "warn is a function");
31 ok(typeof logging.error === "function", "error is a function");
32 ok(typeof logging.setLevel === "function", "setLevel is a function");
33 ok(typeof logging.setDefaultLevel === "function", "setDefaultLevel is a function");
34 ok(typeof logging.enableAll === "function", "enableAll is a function");
35 ok(typeof logging.disableAll === "function", "disableAll is a function");
36 ok(typeof logging.getLogger === "function", "getLogger is a function");
37
38 // Use the API to make sure it doesn't blatantly fail with exceptions
39 logging.trace("a trace message");
40 logging.debug("a debug message");
41 logging.info("an info message");
42 logging.warn("a warn message");
43 logging.error("an error message");
44
45 var newLogger = logging.getLogger("newLogger");
46 newLogger.trace("a trace message");
47 newLogger.debug("a debug message");
48 newLogger.info("an info message");
49 newLogger.warn("a warn message");
50 newLogger.error("an error message");
51});
Note: See TracBrowser for help on using the repository browser.