| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent afcfaa0 commit 82181bb
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,13 +25,15 @@ process.chdir(tmpdir.path); | |||
| 25 | 25 | } | |
| 26 | 26 | ||
| 27 | 27 | { | |
| 28 | - const readonlyFile = 'ro'; | ||
| 29 | - fs.writeFileSync(readonlyFile, Buffer.alloc(0), { mode: 0o444 }); | ||
| 28 | + const directory = 'directory'; | ||
| 29 | + fs.mkdirSync(directory); | ||
| 30 | 30 | assert.throws(() => { | |
| 31 | - writeHeapSnapshot(readonlyFile); | ||
| 31 | + writeHeapSnapshot(directory); | ||
| 32 | 32 | }, (e) => { | |
| 33 | 33 | assert.ok(e, 'writeHeapSnapshot should error'); | |
| 34 | - assert.strictEqual(e.code, 'EACCES'); | ||
| 34 | + // TODO(RaisinTen): This should throw EISDIR on Windows too. | ||
| 35 | + assert.strictEqual(e.code, | ||
| 36 | + process.platform === 'win32' ? 'EACCES' : 'EISDIR'); | ||
| 35 | 37 | assert.strictEqual(e.syscall, 'open'); | |
| 36 | 38 | return true; | |
| 37 | 39 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments