Skip to content

Commit

Permalink
Fix all rimraf usages to the best of my ability; glob is not true by …
Browse files Browse the repository at this point in the history
…default in rimraf; file archive test only passed every other time using async rimraf, could use further investigation
  • Loading branch information
DABH committed Jan 3, 2024
1 parent 8f3c653 commit c3f3b5b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/unit/winston/transports/01-file-maxsize.test.js
Expand Up @@ -18,7 +18,7 @@ const MESSAGE = Symbol.for('message');
// Remove all log fixtures
//
function removeFixtures(done) {
rimraf(path.join(testLogFixturesPath, 'testmaxsize*')).then(() => done());
rimraf(path.join(testLogFixturesPath, 'testmaxsize*'), {glob: true}).then(() => done());
}

describe('File (maxsize)', function () {
Expand Down
5 changes: 3 additions & 2 deletions test/unit/winston/transports/02-file-archive.test.js
Expand Up @@ -4,7 +4,7 @@
*/

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


function removeFixtures(done) {
rimraf(path.join(testLogFixturesPath, 'testarchive*')).then(() => done());
rimrafSync(path.join(testLogFixturesPath, 'testarchive*'), {glob: true});
done();
}

describe('winston/transports/file/zippedArchive', function () {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/winston/transports/file-archive.test.js
Expand Up @@ -20,7 +20,7 @@ const { MESSAGE } = require('triple-beam');
// Remove all log fixtures
//
function removeFixtures(done) {
rimraf(path.join(testLogFixturesPath, 'testarchive*')).then(() => done());
rimraf(path.join(testLogFixturesPath, 'testarchive*'), {glob: true}).then(() => done());
}


Expand Down
2 changes: 1 addition & 1 deletion test/unit/winston/transports/file-rotationFormat.test.js
Expand Up @@ -21,7 +21,7 @@ const testFileFixturesPath = path.join(
// Remove all log fixtures
//
function removeFixtures(done) {
rimraf(path.join(testFileFixturesPath, 'rotation*')).then(() => done());
rimraf(path.join(testFileFixturesPath, 'rotation*'), {glob: true}).then(() => done());
}

// Validate Filename according to rotation
Expand Down
2 changes: 1 addition & 1 deletion test/unit/winston/transports/file-tailrolling.test.js
Expand Up @@ -12,7 +12,7 @@ const { MESSAGE } = require('triple-beam');
// Remove all log fixtures
//
function removeFixtures(done) {
rimraf(path.join(testLogFixturesPath, 'testtailrollingfiles*')).then(() => done());
rimraf(path.join(testLogFixturesPath, 'testtailrollingfiles*'), {glob: true}).then(() => done());
}


Expand Down

0 comments on commit c3f3b5b

Please sign in to comment.