1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

adjust timing on file tail test

Runs cleaner on Mac
This commit is contained in:
Dave Conway-Jones 2015-06-17 22:08:43 +01:00
parent dfd8ab3545
commit 5813a91244
3 changed files with 27 additions and 2 deletions

2
Dockerfile Normal file
View File

@ -0,0 +1,2 @@
FROM node:0.10-onbuild
EXPOSE 1880

20
npm-debug.log Normal file
View File

@ -0,0 +1,20 @@
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'cache', 'clean' ]
2 info using npm@1.4.28
3 info using node@v0.10.36
4 error Error: EACCES, unlink '/Users/conway/.npm/CSSwhat/0.4.7'
4 error { [Error: EACCES, unlink '/Users/conway/.npm/CSSwhat/0.4.7']
4 error errno: 3,
4 error code: 'EACCES',
4 error path: '/Users/conway/.npm/CSSwhat/0.4.7' }
5 error Please try running this command again as root/Administrator.
6 error System Darwin 14.1.0
7 error command "node" "/usr/local/bin/npm" "cache" "clean"
8 error cwd /Users/Projects/node-red
9 error node -v v0.10.36
10 error npm -v 1.4.28
11 error path /Users/conway/.npm/CSSwhat/0.4.7
12 error code EACCES
13 error errno 3
14 error stack Error: EACCES, unlink '/Users/conway/.npm/CSSwhat/0.4.7'
15 verbose exit [ 3, true ]

View File

@ -89,7 +89,7 @@ describe('tail Node', function() {
}); });
it('should handle a non-existent file', function(done) { it('should handle a non-existent file', function(done) {
fs.unlinkSync(fileToTail); fs.writeFileSync(fileToTail, "Tail message line.\n");
var flow = [{id:"tailNode1", type:"tail", name: "tailNode", "split":true, "filename":fileToTail, "wires":[["helperNode1"]]}, var flow = [{id:"tailNode1", type:"tail", name: "tailNode", "split":true, "filename":fileToTail, "wires":[["helperNode1"]]},
{id:"helperNode1", type:"helper", wires:[]}]; {id:"helperNode1", type:"helper", wires:[]}];
helper.load(tailNode, flow, function() { helper.load(tailNode, flow, function() {
@ -100,9 +100,12 @@ describe('tail Node', function() {
msg.payload.should.equal("Tail message line"); msg.payload.should.equal("Tail message line");
done(); done();
}); });
setTimeout(function(){
fs.unlinkSync(fileToTail);
},500);
setTimeout( function() { setTimeout( function() {
fs.writeFile(fileToTail, "Tail message line\n"); fs.writeFile(fileToTail, "Tail message line\n");
},wait); },1000);
}); });
}); });