mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
chore(test): fixed teardown() causing tests to fail due to fs errors on removal
This commit is contained in:
parent
43a2199137
commit
a0baec23a8
@ -236,8 +236,14 @@ test("multiFile appender", batch => {
|
||||
});
|
||||
});
|
||||
|
||||
batch.tearDown(() => {
|
||||
fs.rmdirSync("logs");
|
||||
batch.tearDown(async () => {
|
||||
try {
|
||||
const files = fs.readdirSync("logs");
|
||||
await removeFiles(files.map(filename => `logs/${filename}`));
|
||||
fs.rmdirSync("logs");
|
||||
} catch (e) {
|
||||
// doesn't matter
|
||||
}
|
||||
});
|
||||
|
||||
batch.end();
|
||||
|
||||
@ -77,11 +77,16 @@ tap.test("Drain event test", batch => {
|
||||
logger.info("This is a test for emitting drain event in date file logger");
|
||||
}
|
||||
t.end();
|
||||
|
||||
});
|
||||
|
||||
batch.tearDown(() => {
|
||||
fs.rmdirSync("logs");
|
||||
batch.tearDown(async () => {
|
||||
try {
|
||||
const files = fs.readdirSync("logs");
|
||||
await removeFiles(files.map(filename => `logs/${filename}`));
|
||||
fs.rmdirSync("logs");
|
||||
} catch (e) {
|
||||
// doesn't matter
|
||||
}
|
||||
});
|
||||
|
||||
batch.end();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user