mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-22 14:04:44 +00:00
.
This commit is contained in:
parent
a004f0ae58
commit
fc725ba36b
7280 changed files with 19 additions and 1796407 deletions
31
node_modules/@cnakazawa/watch/test/test_monitor.js
generated
vendored
31
node_modules/@cnakazawa/watch/test/test_monitor.js
generated
vendored
|
@ -1,31 +0,0 @@
|
|||
var watch = require('../main')
|
||||
, assert = require('assert')
|
||||
, path = require('path')
|
||||
, fs = require('fs')
|
||||
, target = path.join(__dirname, "d/t")
|
||||
;
|
||||
|
||||
function clearFile() {
|
||||
fs.writeFileSync(target, '')
|
||||
}
|
||||
|
||||
clearFile()
|
||||
|
||||
// test if changed event is fired correctly
|
||||
watch.createMonitor(__dirname, { interval: 150 },
|
||||
function (monitor) {
|
||||
monitor.once('changed', function (f) {
|
||||
assert.equal(f, target);
|
||||
clearFile();
|
||||
process.exit(0)
|
||||
})
|
||||
|
||||
fs.writeFile(target, 'Test Write\n', function (err) {
|
||||
if (err) throw err;
|
||||
|
||||
setTimeout(function () {
|
||||
// should have got the other assert done by now
|
||||
assert.ok(false);
|
||||
}, 300);
|
||||
})
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue