Skip to content
This repository was archived by the owner on May 23, 2021. It is now read-only.

Commit 286b7d5

Browse files
committed
Fix mkdirp error test in CI
1 parent 68f335e commit 286b7d5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/util.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ describe("util", () => {
1212
assert.equal(mkdirp(target), undefined)
1313
assert.equal(await fs.pathExists(target), true)
1414
assert.equal(mkdirp(target), undefined) // Shouldn't throw if it exists.
15-
assert.throws(() => mkdirp(path.join("/unauthorized/foo/bar/baz")), /permission denied/)
15+
16+
// In CI we have permissions so we'll write a file to force an error.
17+
try {
18+
await fs.writeFile("/file", "")
19+
} catch (error) {
20+
// No problem.
21+
}
22+
assert.throws(() => mkdirp(path.join("/file/foo/bar/baz")), /Error/)
1623
})
1724
})

0 commit comments

Comments
 (0)