diff --git a/test/parallel/test-fs-open-flags.js b/test/parallel/test-fs-open-flags.js index d2be078812f351..0aa467c6e96f96 100644 --- a/test/parallel/test-fs-open-flags.js +++ b/test/parallel/test-fs-open-flags.js @@ -22,8 +22,12 @@ // Flags: --expose_internals 'use strict'; const common = require('../common'); + +const fixtures = require('../common/fixtures'); + const assert = require('assert'); const fs = require('fs'); +const path = require('path'); const O_APPEND = fs.constants.O_APPEND || 0; const O_CREAT = fs.constants.O_CREAT || 0; @@ -79,9 +83,10 @@ assert.throws( /^Error: Unknown file open flag: null$/ ); -if (common.isLinux) { - const file = `${__dirname}/../fixtures/a.js`; - +if (common.isLinux || common.isOSX) { + common.refreshTmpDir(); + const file = path.join(common.tmpDir, 'a.js'); + fs.copyFileSync(fixtures.path('a.js'), file); fs.open(file, O_DSYNC, common.mustCall(assert.ifError)); }