mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
491 B
27 lines
491 B
process.mixin(require("./common"));
|
|
|
|
var path = require("path");
|
|
|
|
var f = path.join(fixturesDir, "x.txt");
|
|
var f2 = path.join(fixturesDir, "x2.txt");
|
|
|
|
puts("watching for changes of " + f);
|
|
|
|
var changes = 0;
|
|
process.watchFile(f, function () {
|
|
puts(f + " change");
|
|
changes++;
|
|
process.unwatchFile(f);
|
|
});
|
|
|
|
|
|
var File = require("file").File;
|
|
|
|
var file = new File(f, 'w+');
|
|
file.write('xyz\n');
|
|
file.close().wait();
|
|
|
|
|
|
process.addListener("exit", function () {
|
|
assertTrue(changes > 0);
|
|
});
|
|
|