Skip to content

Commit 6541386

Browse files
committed
test: changed to /tmp to __dirname to avoid weird permission errors between windows and linux
1 parent f7e1422 commit 6541386

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

test/RollingFileWriteStream-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,11 +1419,11 @@ describe("RollingFileWriteStream", () => {
14191419

14201420
describe("when deleting old files and there is an error", () => {
14211421
before(done => {
1422-
fs.ensureDir('/tmp/delete-test/logfile.log.2', done);
1422+
fs.ensureDir(path.join(__dirname, "tmp-delete-test/logfile.log.2"), done);
14231423
});
14241424

14251425
it("should not let errors bubble up", done => {
1426-
const s = new RollingFileWriteStream("/tmp/delete-test/logfile.log", {
1426+
const s = new RollingFileWriteStream(path.join(__dirname, "tmp-delete-test/logfile.log"), {
14271427
maxSize: 10,
14281428
numToKeep: 1
14291429
});
@@ -1435,7 +1435,7 @@ describe("RollingFileWriteStream", () => {
14351435
});
14361436

14371437
after(done => {
1438-
fs.remove('/tmp/delete-test', done);
1439-
})
1438+
fs.remove(path.join(__dirname, "tmp-delete-test"), done);
1439+
});
14401440
});
14411441
});

test/moveAndMaybeCompressFile-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const path = require('path');
55
const zlib = require('zlib');
66
const proxyquire = require('proxyquire').noPreserveCache();
77
const moveAndMaybeCompressFile = require('../lib/moveAndMaybeCompressFile');
8-
const TEST_DIR = path.normalize(`/tmp/moveAndMaybeCompressFile_${Math.floor(Math.random()*10000)}`);
8+
const TEST_DIR = path.join(__dirname, `moveAndMaybeCompressFile_${Math.floor(Math.random()*10000)}`);
99

1010
describe('moveAndMaybeCompressFile', () => {
1111
beforeEach(async () => {

0 commit comments

Comments
 (0)