Skip to content

Commit c3f3b5b

Browse files
committed
Fix all rimraf usages to the best of my ability; glob is not true by default in rimraf; file archive test only passed every other time using async rimraf, could use further investigation
1 parent 8f3c653 commit c3f3b5b

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

test/unit/winston/transports/01-file-maxsize.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const MESSAGE = Symbol.for('message');
1818
// Remove all log fixtures
1919
//
2020
function removeFixtures(done) {
21-
rimraf(path.join(testLogFixturesPath, 'testmaxsize*')).then(() => done());
21+
rimraf(path.join(testLogFixturesPath, 'testmaxsize*'), {glob: true}).then(() => done());
2222
}
2323

2424
describe('File (maxsize)', function () {

test/unit/winston/transports/02-file-archive.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
/* eslint-disable no-sync */
7-
const { rimraf } = require('rimraf');
7+
const { rimrafSync } = require('rimraf');
88
const fs = require('fs');
99
const path = require('path');
1010
const { MESSAGE } = require('triple-beam');
@@ -22,7 +22,8 @@ const testLogFixturesPath = path.join(
2222

2323

2424
function removeFixtures(done) {
25-
rimraf(path.join(testLogFixturesPath, 'testarchive*')).then(() => done());
25+
rimrafSync(path.join(testLogFixturesPath, 'testarchive*'), {glob: true});
26+
done();
2627
}
2728

2829
describe('winston/transports/file/zippedArchive', function () {

test/unit/winston/transports/file-archive.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const { MESSAGE } = require('triple-beam');
2020
// Remove all log fixtures
2121
//
2222
function removeFixtures(done) {
23-
rimraf(path.join(testLogFixturesPath, 'testarchive*')).then(() => done());
23+
rimraf(path.join(testLogFixturesPath, 'testarchive*'), {glob: true}).then(() => done());
2424
}
2525

2626

test/unit/winston/transports/file-rotationFormat.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const testFileFixturesPath = path.join(
2121
// Remove all log fixtures
2222
//
2323
function removeFixtures(done) {
24-
rimraf(path.join(testFileFixturesPath, 'rotation*')).then(() => done());
24+
rimraf(path.join(testFileFixturesPath, 'rotation*'), {glob: true}).then(() => done());
2525
}
2626

2727
// Validate Filename according to rotation

test/unit/winston/transports/file-tailrolling.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const { MESSAGE } = require('triple-beam');
1212
// Remove all log fixtures
1313
//
1414
function removeFixtures(done) {
15-
rimraf(path.join(testLogFixturesPath, 'testtailrollingfiles*')).then(() => done());
15+
rimraf(path.join(testLogFixturesPath, 'testtailrollingfiles*'), {glob: true}).then(() => done());
1616
}
1717

1818

0 commit comments

Comments
 (0)