test.ok(result.indexOf('lib/added.js was indeed added')!==-1,'event not emitted when file added');
test.ok(result.indexOf('lib/added.js was indeed added')!==-1,
test.ok(result.indexOf('lib/one.js was indeed changed')!==-1,'event not emitted when file changed');
'event not emitted when file added');
test.ok(result.indexOf('lib/added.js was indeed deleted')!==-1,'event not emitted when file deleted');
test.ok(result.indexOf('lib/one.js was indeed changed')!==-1,
'event not emitted when file changed');
test.ok(result.indexOf('lib/added.js was indeed deleted')!==-1,
'event not emitted when file deleted');
test.done();
test.done();
});
});
},
},
@ -59,9 +62,12 @@ exports.events = {
}],function(result){
}],function(result){
result=helper.unixify(result);
result=helper.unixify(result);
helper.verboseLog(result);
helper.verboseLog(result);
test.ok(result.indexOf('lib/added.js was indeed added')!==-1,'event not emitted when file added');
test.ok(result.indexOf('lib/added.js was indeed added')!==-1,
test.ok(result.indexOf('lib/one.js was indeed changed')===-1,'event should NOT have emitted when file changed');
'event not emitted when file added');
test.ok(result.indexOf('lib/added.js was indeed deleted')===-1,'event should NOT have emitted when file deleted');
test.ok(result.indexOf('lib/one.js was indeed changed')===-1,
'event should NOT have emitted when file changed');
test.ok(result.indexOf('lib/added.js was indeed deleted')===-1,
'event should NOT have emitted when file deleted');
test.done();
test.done();
});
});
},
},
@ -74,9 +80,12 @@ exports.events = {
}],function(result){
}],function(result){
result=helper.unixify(result);
result=helper.unixify(result);
helper.verboseLog(result);
helper.verboseLog(result);
test.ok(result.indexOf('lib/added.js was indeed added')===-1,'event should NOT have emitted when file added');
test.ok(result.indexOf('lib/added.js was indeed added')===-1,
test.ok(result.indexOf('lib/one.js was indeed changed')!==-1,'event should have emitted when file changed');
'event should NOT have emitted when file added');
test.ok(result.indexOf('lib/added.js was indeed deleted')===-1,'event should NOT have emitted when file deleted');
test.ok(result.indexOf('lib/one.js was indeed changed')!==-1,
'event should have emitted when file changed');
test.ok(result.indexOf('lib/added.js was indeed deleted')===-1,
'event should NOT have emitted when file deleted');
test.done();
test.done();
});
});
},
},
@ -89,9 +98,12 @@ exports.events = {
}],function(result){
}],function(result){
result=helper.unixify(result);
result=helper.unixify(result);
helper.verboseLog(result);
helper.verboseLog(result);
test.ok(result.indexOf('lib/added.js was indeed added')===-1,'event should NOT have emitted when file added');
test.ok(result.indexOf('lib/added.js was indeed added')===-1,
test.ok(result.indexOf('lib/one.js was indeed changed')===-1,'event should NOT have emitted when file changed');
'event should NOT have emitted when file added');
test.ok(result.indexOf('lib/added.js was indeed deleted')!==-1,'event should have emitted when file deleted');
test.ok(result.indexOf('lib/one.js was indeed changed')===-1,
'event should NOT have emitted when file changed');
test.ok(result.indexOf('lib/added.js was indeed deleted')!==-1,
'event should have emitted when file deleted');
test.done();
test.done();
});
});
},
},
@ -104,9 +116,13 @@ exports.events = {
}],function(result){
}],function(result){
result=helper.unixify(result);
result=helper.unixify(result);
helper.verboseLog(result);
helper.verboseLog(result);
test.ok(result.indexOf('lib/added.js was indeed added')!==-1,'event should have emitted when file added');
test.ok(result.indexOf('lib/added.js was indeed added')!==-1,
test.ok(result.indexOf('lib/one.js was indeed changed')===-1,'event should NOT have emitted when file changed');
'event should have emitted when file added');
test.ok(result.indexOf('lib/added.js was indeed deleted')!==-1,'event should have emitted when file deleted');
test.ok(result.indexOf('lib/one.js was indeed changed')===-1,
'event should NOT have emitted when file changed');
test.ok(result.indexOf('lib/added.js was indeed deleted')!==-1,
'event should have emitted when file deleted');
test.done();
test.done();
});
});
},
},
@ -125,8 +141,10 @@ exports.events = {
}],function(result){
}],function(result){
result=helper.unixify(result);
result=helper.unixify(result);
helper.verboseLog(result);
helper.verboseLog(result);
test.ok(result.indexOf('lib/one/test.js was indeed changed\ntargetOne specifc event was fired')!==-1,'event should have been emitted with targetOne specified');
test.ok(result.indexOf('lib/one/test.js was indeed changed\ntargetOne specifc event was fired')!==-1,
test.ok(result.indexOf('lib/two/test.js was indeed changed\ntargetTwo specifc event was fired')!==-1,'event should have been emitted with targetTwo specified');
'event should have been emitted with targetOne specified');
test.ok(result.indexOf('lib/two/test.js was indeed changed\ntargetTwo specifc event was fired')!==-1,
'event should have been emitted with targetTwo specified');
test.ok(result.indexOf('I ran before livereload.')!==-1,'task should have ran before live reload.');
test.ok(result.indexOf('I ran before livereload.')!==-1,'task should have ran before live reload.');
test.ok(result.indexOf('Live reload server started on port: 35729')!==-1,'live reload server should have been started on port 35729.');
test.ok(result.indexOf('Live reload server started on port: 35729')!==-1,
'live reload server should have been started on port 35729.');
test.ok(result.indexOf('Live reloading lib/one.js...')!==-1,'live reload should have triggered on lib/one.js');
test.ok(result.indexOf('Live reloading lib/one.js...')!==-1,'live reload should have triggered on lib/one.js');
resultData=JSON.parse(resultData);
resultData=JSON.parse(resultData);
test.equal(resultData.tinylr,'Welcome','tinylr server should have welcomed you.');
test.equal(resultData.tinylr,'Welcome','tinylr server should have welcomed you.');
@ -77,7 +78,8 @@ exports.livereload = {
result=helper.unixify(result);
result=helper.unixify(result);
helper.verboseLog(result);
helper.verboseLog(result);
test.ok(result.indexOf('I ran before livereload.')!==-1,'task should have ran before live reload.');
test.ok(result.indexOf('I ran before livereload.')!==-1,'task should have ran before live reload.');
test.ok(result.indexOf('Live reload server started on port: 8675')!==-1,'live reload server should have been started on port 35729.');
test.ok(result.indexOf('Live reload server started on port: 8675')!==-1,
'live reload server should have been started on port 35729.');
test.ok(result.indexOf('Live reloading lib/one.js...')!==-1,'live reload should have triggered on lib/one.js');
test.ok(result.indexOf('Live reloading lib/one.js...')!==-1,'live reload should have triggered on lib/one.js');
resultData=JSON.parse(resultData);
resultData=JSON.parse(resultData);
test.equal(resultData.tinylr,'Welcome','tinylr server should have welcomed you.');
test.equal(resultData.tinylr,'Welcome','tinylr server should have welcomed you.');
@ -97,7 +99,8 @@ exports.livereload = {
helper.verboseLog(result);
helper.verboseLog(result);
test.ok(result.indexOf('Live reloading lib/one.js...')!==-1,'live reload should have triggered on lib/one.js');
test.ok(result.indexOf('Live reloading lib/one.js...')!==-1,'live reload should have triggered on lib/one.js');
test.ok(result.indexOf('Live reloading lib/two.js...')!==-1,'live reload should have triggered on lib/two.js');
test.ok(result.indexOf('Live reloading lib/two.js...')!==-1,'live reload should have triggered on lib/two.js');
test.ok(!/Live reloading (lib\/one\.js, lib\/two.js|lib\/two.js, lib\/one.js)\.\.\./.test(result),'live reload should have cleared js file that was already reloaded');
'live reload should have cleared js file that was already reloaded');
test.done();
test.done();
});
});
},
},
@ -116,8 +119,10 @@ exports.livereload = {
result=helper.unixify(result);
result=helper.unixify(result);
helper.verboseLog(result);
helper.verboseLog(result);
test.ok(result.indexOf('I ran before livereload.')!==-1,'task should have ran before live reload.');
test.ok(result.indexOf('I ran before livereload.')!==-1,'task should have ran before live reload.');
test.ok(result.indexOf('Live reload server started on port: 9876')!==-1,'live reload server should have been started on port 9876.');
test.ok(result.indexOf('Live reload server started on port: 9876')!==-1,
test.ok(/Live reloading (lib\/one\.js, lib\/two.js|lib\/two.js, lib\/one.js)\.\.\./.test(result),'live reload should have triggered on lib/one.js and lib/two.js');
'live reload server should have been started on port 9876.');