Skip to content

ENOENT when setting fs.watch #246

Closed
Closed
@cburroughs

Description

@cburroughs
'use strict';

const fs = require('fs');
const mockfs = require('mock-fs');

mockfs({'/foo': {'a': '', 'b': '', 'c': ''}});
console.log('dir contents',  fs.readdirSync('/foo'));
fs.watch('/foo', {}, function _onDirEvent(evt) {
    console.log('evt', evt);
});
$ node foo.js 
dir contents [ 'a', 'b', 'c' ]
fs.js:1236
    throw error;
    ^

Error: watch /foo ENOENT

I could not find fs.watch defined anywhere in mock-fs, but also saw that #207 removed a caveat about fs.watch not being implemented. I'm not sure if I'm missing something obvious or if fs.watch is unsupported.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions