From d94284aeb81c0c63df4ed0db6fef9a051edd7cb1 Mon Sep 17 00:00:00 2001 From: Lam Wei Li Date: Fri, 4 Feb 2022 17:43:37 +0800 Subject: [PATCH] chore(test): improve test coverage for fileAppender appenders/file.js - Line 70 - return d; --- test/tap/fileAppender-test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/tap/fileAppender-test.js b/test/tap/fileAppender-test.js index 8a11f2e..95ee8a4 100644 --- a/test/tap/fileAppender-test.js +++ b/test/tap/fileAppender-test.js @@ -386,19 +386,19 @@ test("log4js fileAppender", batch => { }); logger.info("This should be in the file.", - "\x1b[33mColor\x1b[0m \x1b[93;41mshould\x1b[0m be \x1b[38;5;8mplain\x1b[0m."); + "\x1b[33mColor\x1b[0m \x1b[93;41mshould\x1b[0m be \x1b[38;5;8mplain\x1b[0m.", {}, []); await sleep(100); let fileContents = await fs.readFile(testFilePlain, "utf8"); - t.match(fileContents, `This should be in the file. Color should be plain.${EOL}`); + t.match(fileContents, `This should be in the file. Color should be plain. {} []${EOL}`); t.match( fileContents, /\[\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}] \[INFO] default-settings - / ); - + fileContents = await fs.readFile(testFileAsIs, "utf8"); t.match(fileContents, "This should be in the file.", - `\x1b[33mColor\x1b[0m \x1b[93;41mshould\x1b[0m be \x1b[38;5;8mplain\x1b[0m.${EOL}`); + `\x1b[33mColor\x1b[0m \x1b[93;41mshould\x1b[0m be \x1b[38;5;8mplain\x1b[0m. {} []${EOL}`); t.match( fileContents, /\[\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}] \[INFO] default-settings - /