()
| 26 | }, common.platformTimeout(30_000)); |
| 27 | |
| 28 | function doWatch() { |
| 29 | const watcher = watch(tmpDir, { recursive: true }, common.mustCall((eventType, _filename) => { |
| 30 | clearTimeout(keepalive); |
| 31 | watcher.close(); |
| 32 | assert.strictEqual(eventType, 'rename'); |
| 33 | assert.strictEqual(join(tmpDir, _filename), filename); |
| 34 | })); |
| 35 | |
| 36 | // Do the write with a delay to ensure that the OS is ready to notify us. |
| 37 | setTimeout(() => { |
| 38 | writeFileSync(filename, 'foobar2'); |
| 39 | }, common.platformTimeout(200)); |
| 40 | } |
| 41 | |
| 42 | if (common.isMacOS) { |
| 43 | // On macOS delay watcher start to avoid leaking previous events. |
no test coverage detected
searching dependent graphs…