Skip to content

Commit

Permalink
test: improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Sketon committed Sep 9, 2023
1 parent a391fd6 commit e9433c3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/index.js
Expand Up @@ -328,6 +328,18 @@ describe('hexo-log', () => {
consoleWarnSpy.args[0].length.should.eql(0);
consoleErrorSpy.args[0][0].should.eql('test: %s');
});

it('error object with log info', () => {
const consoleInfoSpy = sinon.spy();

loggerModule.__set__('console.info', consoleInfoSpy);

loggerModule.__with__(fakeProcess)(() => {
const log = loggerModule.logger();
log.info({err: new Error('test')});
});
consoleInfoSpy.args[0].length.should.eql(0);
});
});

describe('hexo-log example', () => {
Expand Down

0 comments on commit e9433c3

Please sign in to comment.