mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
chore(test): improve test coverage for fileAppender
appenders/file.js - Line 70 - return d;
This commit is contained in:
parent
42eb04e266
commit
d94284aeb8
@ -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 - /
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user