Skip to content

Commit c478fe3

Browse files
committed
test: watch on root disk should cause permission error throw
1 parent 5f86dae commit c478fe3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/test-watcher.browser.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,16 @@ function _setupTests(testType) {
366366
expect(watcher2PathChangeArray).to.deep.include({ path: watchPath, watchEvent: CHANGE});
367367
});
368368

369+
it(`Should phoenix ${testType} watch throw error if trying to watch root dir`, async function () {
370+
let err;
371+
try{
372+
await fs.watchAsync("/tauri/");
373+
} catch (e) {
374+
err = e;
375+
}
376+
expect(err.code).to.eql(fs.ERR_CODES.EPERM);
377+
});
378+
369379
it(`Should phoenix ${testType} watch for folder rename with nested contents`, async function () {
370380
const watchPath = `${testPath}/watch`;
371381
await _creatDirAndValidate(watchPath);

0 commit comments

Comments
 (0)