Skip to content

Commit

Permalink
test: improve coverage (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Sketon authored Sep 11, 2023
1 parent a391fd6 commit 8cc5d3c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
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 8cc5d3c

Please sign in to comment.