Skip to content

Commit

Permalink
chore(test): Fixed teardown() because tests are failing
Browse files Browse the repository at this point in the history
  • Loading branch information
lamweili committed Jan 19, 2022
1 parent 43a2199 commit 057d8f8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
11 changes: 9 additions & 2 deletions test/tap/multi-file-appender-test.js
Expand Up @@ -236,8 +236,15 @@ 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) {
throw e;
// doesn't matter
}
});

batch.end();
Expand Down
12 changes: 9 additions & 3 deletions test/tap/pause-test.js
Expand Up @@ -77,11 +77,17 @@ 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) {
throw e;
// doesn't matter
}
});

batch.end();
Expand Down

0 comments on commit 057d8f8

Please sign in to comment.