diff --git a/test/sequential/test-heapdump.js b/test/sequential/test-heapdump.js index e18c6189332574..9b45aa41992fd1 100644 --- a/test/sequential/test-heapdump.js +++ b/test/sequential/test-heapdump.js @@ -25,13 +25,15 @@ process.chdir(tmpdir.path); } { - const readonlyFile = 'ro'; - fs.writeFileSync(readonlyFile, Buffer.alloc(0), { mode: 0o444 }); + const directory = 'directory'; + fs.mkdirSync(directory); assert.throws(() => { - writeHeapSnapshot(readonlyFile); + writeHeapSnapshot(directory); }, (e) => { assert.ok(e, 'writeHeapSnapshot should error'); - assert.strictEqual(e.code, 'EACCES'); + // TODO(RaisinTen): This should throw EISDIR on Windows too. + assert.strictEqual(e.code, + process.platform === 'win32' ? 'EACCES' : 'EISDIR'); assert.strictEqual(e.syscall, 'open'); return true; });