Skip to content

Commit c6f8160

Browse files
author
Gareth Jones
committed
fix(tests): full coverage
1 parent fe77601 commit c6f8160

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"prepush": "npm test",
99
"commitmsg": "validate-commit-msg",
1010
"pretest": "eslint lib/**/* test/**/*",
11-
"test": "tap 'test/**/*.js'",
12-
"coverage": "tap 'test/**/*.js' --cov",
11+
"test": "tap 'test/**/*.js' --100",
12+
"coverage": "tap 'test/**/*.js' --100",
1313
"codecov": "tap 'test/**/*.js' --cov --coverage-report=lcov && codecov"
1414
},
1515
"keywords": [

test/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ test('../lib/index.js', (batch) => {
1616

1717
t.test('logger should provide dummy functions for context', (assert) => {
1818
assert.isA(logger.addContext, 'function');
19+
assert.doesNotThrow(() => { logger.addContext('cheese', 'biscuits'); });
1920
assert.isA(logger.removeContext, 'function');
21+
assert.doesNotThrow(() => { logger.removeContext('cheese'); });
2022
assert.isA(logger.clearContext, 'function');
23+
assert.doesNotThrow(() => { logger.clearContext(); });
2124
assert.end();
2225
});
2326

@@ -31,8 +34,14 @@ test('../lib/index.js', (batch) => {
3134

3235
t.test('logger should provide logging functions', (assert) => {
3336
assert.isA(logger.log, 'function');
37+
assert.doesNotThrow(() => {
38+
logger.log('some','dummy','arguments');
39+
});
3440
['trace','debug','info','warn','error', 'fatal'].forEach((level) => {
3541
assert.isA(logger[level], 'function');
42+
assert.doesNotThrow(() => {
43+
logger[level]('some','dummy','arguments');
44+
});
3645
});
3746
assert.end();
3847
});

0 commit comments

Comments
 (0)