test: clean string for trigger check

This commit is contained in:
Remy Sharp
2015-09-23 09:00:52 +01:00
parent 8a0ce0941f
commit b875ffc9c0
2 changed files with 8 additions and 1 deletions

View File

@@ -153,7 +153,7 @@ describe('nodemon fork child restart', function () {
},
output: function (data) {
var msg = colour.strip(data.trim());
if (monitor(msg)) {
if (utils.match(msg, 'changes after filters (before/after)')) {
var changes = msg.split(/\n/).shift();
changes = changes.replace(/\s*/gm, '').slice(-5).split('/');
var restartedOn = changes.pop();

View File

@@ -115,7 +115,14 @@ Plan.prototype.assert = function() {
}
};
function getTriggerCount(msg) {
var changes = msg.split(/\n/).shift();
changes = changes.replace(/\s*/gm, '').slice(-5).split('/');
return changes.pop();
}
module.exports = {
getTriggerCount: getTriggerCount,
Plan: Plan,
asCLI: asCLI,
match: match,