summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-watch-ref-unref.js
blob: e51ecaf5b2fcc108a0dfb23f16f266035a245b37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'use strict';

const common = require('../common');

if (common.isIBMi)
  common.skip('IBMi does not support `fs.watch()`');

const fs = require('fs');

const watcher = fs.watch(__filename, common.mustNotCall());

watcher.unref();

setTimeout(
  common.mustCall(() => {
    watcher.ref();
    watcher.unref();
  }),
  common.platformTimeout(100)
);