-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
doc: list macOS as supporting filename argument #13111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Fixes: #13108
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,3 +63,25 @@ fs.watchFile(enoentFile, {interval: 0}, common.mustCall(function(curr, prev) { | |
| fs.unwatchFile(enoentFile); | ||
| } | ||
| }, 2)); | ||
|
|
||
| // Watch events should callback with a filename | ||
| if (common.isLinux || common.isOSX) { | ||
| const dir = common.tmpDir + '/watch'; | ||
|
|
||
| fs.mkdir(dir, common.mustCall(function(err) { | ||
| assert(!err); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you could use |
||
|
|
||
| fs.watch(dir, common.mustCall(function(eventType, filename) { | ||
| this._handle.close(); | ||
| common.refreshTmpDir(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the test to pass on |
||
| assert.strictEqual(filename, 'foo.txt'); | ||
| })); | ||
|
|
||
| fs.writeFile(`${dir}/foo.txt`, 'foo', common.mustCall((err) => { | ||
| if (err) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you should replace the whole callback with |
||
| common.refreshTmpDir(); | ||
| assert(!err); | ||
| } | ||
| })); | ||
| })); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add Windows too. You can also add AIX according to @gireeshpunathil's suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just checked, it passes on windows.