Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Jan 21, 2024
1 parent d1cd047 commit 07e58d5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/lib/core/logger.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@ describe('test/lib/core/logger.test.js', () => {
const logfile = path.join(app.config.logger.dir, 'common-error.log');
// app.config.logger.buffer.should.equal(false);
ctx.logger.error(new Error('mock nobuffer error'));
await utils.sleep(2000);
assert(
fs.readFileSync(logfile, 'utf8').includes('nodejs.Error: mock nobuffer error\n')
);
await utils.sleep(1000);
if (process.platform !== 'darwin') {
// skip check on macOS
assert(
fs.readFileSync(logfile, 'utf8').includes('nodejs.Error: mock nobuffer error\n')
);
}
});

it('log buffer enable cache on non-local and non-unittest env', async () => {
Expand Down

0 comments on commit 07e58d5

Please sign in to comment.