-
Notifications
You must be signed in to change notification settings - Fork 10
/
runtest.js
executable file
·54 lines (40 loc) · 1.22 KB
/
runtest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env node
'use strict';
var fuse = require('fuse-bindings');
var fusile = require('./lib');
var mkdirp = require('mkdirp');
var testTarget = '__TEST_MOUNT_POINT';
mkdirp(testTarget);
fusile('fixtures/source', testTarget, {
watches: ['**/*.*'],
verbose: true
});
///////
// var fs = require('fs');
// var path = require('path');
// var origFile = path.join(process.cwd(), 'test/fixtures/source', 'unchanged.txt');
// var fuseFile = path.join(process.cwd(), testTarget, 'unchanged.txt');
// var shortFuseFile = path.join(testTarget, 'unchanged.txt');
// setTimeout(function () {
// fs.watch(shortFuseFile, function (event, pathname) {
// console.log('watcher', event, pathname);
// });
// setInterval(function () {
// console.log('Touching', origFile);
// fs.utimes(origFile, new Date(), new Date());
// }, 1000);
// setTimeout(function () {
// fs.readFile(fuseFile, 'utf-8', function (err, data) {
// console.log('readFile', err, data);
// });
// }, 2000);
// }, 100);
///////
// Start reading from stdin
process.stdin.resume();
process.on('SIGINT', function () {
fuse.unmount(testTarget, function () {
console.error('Unmounted: ' + testTarget);
process.exit(0);
});
});