diff --git a/test/test.js b/test/test.js index e523d0c..647a334 100644 --- a/test/test.js +++ b/test/test.js @@ -4,6 +4,7 @@ const tape = require('tape') const crypto = require('crypto') const fs = require('fs') const path = require('path') +const os = require('os') const BufferList = require('../') const { Buffer } = require('buffer') @@ -506,11 +507,11 @@ tape('uninitialized memory', function (t) { t.ok(random.equals(bl.slice())) t.ok(random.equals(buf.slice())) - bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat')) + bl.pipe(fs.createWriteStream(path.join(os.tmpdir(), 'bl_test_rnd_out.dat'))) .on('close', function () { const rndhash = crypto.createHash('md5').update(random).digest('hex') const md5sum = crypto.createHash('md5') - const s = fs.createReadStream('/tmp/bl_test_rnd_out.dat') + const s = fs.createReadStream(path.join(os.tmpdir(), 'bl_test_rnd_out.dat')) s.on('data', md5sum.update.bind(md5sum)) s.on('end', function () { @@ -520,8 +521,8 @@ tape('uninitialized memory', function (t) { }) }) - fs.writeFileSync('/tmp/bl_test_rnd.dat', random) - fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl) + fs.writeFileSync(path.join(os.tmpdir(), 'bl_test_rnd.dat'), random) + fs.createReadStream(path.join(os.tmpdir(), 'bl_test_rnd.dat')).pipe(bl) }) tape('instantiation with Buffer', function (t) {