Ignore:
Timestamp:
11/25/21 22:08:24 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
8d391a1
Parents:
59329aa
Message:

primeNG components

Location:
trip-planner-front/node_modules/loglevel/test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/node_modules/loglevel/test/default-level-test.js

    r59329aa re29cc2e  
    5757            });
    5858        });
     59
     60        describe("log.resetLevel() resets the log", function() {
     61            it("to warn if no explicit default is set", function(log) {
     62                log.setLevel("debug");
     63                log.resetLevel();
     64
     65                expect(log).toBeAtLevel("warn");
     66            });
     67
     68            it("to info if default is set to info", function(log) {
     69                log.setDefaultLevel("info");
     70                log.setLevel("debug");
     71                log.resetLevel();
     72
     73                expect(log).toBeAtLevel("info");
     74            });
     75        });
    5976    });
    6077});
  • trip-planner-front/node_modules/loglevel/test/local-storage-test.js

    r59329aa re29cc2e  
    9797                expect("error").not.toBeTheStoredLevel();
    9898            });
     99
     100            it("log.resetLevel() clears the saved level", function(log) {
     101                log.resetLevel();
     102
     103                expect(undefined).toBeTheStoredLevel();
     104                expect("info").not.toBeTheStoredLevel();
     105            });
    99106        });
    100107
  • trip-planner-front/node_modules/loglevel/test/test-helpers.js

    r59329aa re29cc2e  
    6868
    6969    self.toBeTheLevelStoredByCookie = function toBeTheLevelStoredByCookie(name) {
    70         var level = this.actual.toUpperCase();
     70        var level = this.actual === undefined ? undefined : this.actual.toUpperCase();
    7171        var storageKey = encodeURIComponent(getStorageKey(name));
    7272
    73         if (window.document.cookie.indexOf(storageKey + "=" + level) !== -1) {
     73        if(level === undefined) {
     74            return window.document.cookie.indexOf(storageKey + "=") === -1;
     75        } else if (window.document.cookie.indexOf(storageKey + "=" + level) !== -1) {
    7476            return true;
    7577        } else {
     
    7981
    8082    self.toBeTheLevelStoredByLocalStorage = function toBeTheLevelStoredByLocalStorage(name) {
    81         var level = this.actual.toUpperCase();
     83        var level = this.actual === undefined ? undefined : this.actual.toUpperCase();
    8284
    8385        if (window.localStorage[getStorageKey(name)] === level) {
Note: See TracChangeset for help on using the changeset viewer.