Skip to content

Commit

Permalink
add tests for possible issue. see tobiipro/minlog#28
Browse files Browse the repository at this point in the history
  • Loading branch information
andreineculau committed Jun 25, 2020
1 parent 1bbab6e commit e91a152
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/minlog.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ describe('minlog', function() {
expect(upperLevelCode).toBe(vanillaLevelCode);
});
});

it('should throw if level is unknown', function() {
expect(function() {
logger.levelToLevelCode('unknown');
}).toThrow(/^Unknown level name unknown./);
});
});

describe('levelToLevelName', function() {
Expand All @@ -149,6 +155,12 @@ describe('minlog', function() {
expect(levelName).toBe(`lvl${level}`);
});
});

it('should throw if level is unknown', function() {
expect(function() {
logger.levelToLevelName('unknown');
}).toThrow(/^Unknown level name unknown./);
});
});

describe('maxLevelCodeInGroup', function() {
Expand Down

0 comments on commit e91a152

Please sign in to comment.