public
/
html-minifier.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b328d50
)
grunt qunit: Don't break in JSON.parse when debug output is generated while running...
author
Andreas Lind
<andreas@one.com>
Mon, 22 May 2017 07:17:18 +0000
(09:17 +0200)
committer
Andreas Lind
<andreas@one.com>
Mon, 22 May 2017 07:17:18 +0000
(09:17 +0200)
Gruntfile.js
patch
|
blob
|
history
diff --git
a/Gruntfile.js
b/Gruntfile.js
index
caf4790
..
6bdbfb4
100644
(file)
--- a/
Gruntfile.js
+++ b/
Gruntfile.js
@@
-141,7
+141,15
@@
module.exports = function(grunt) {
errors.push(-1);
}
else {
errors.push(-1);
}
else {
- errors.push(report(testType, JSON.parse(result.stdout)));
+ var output = result.stdout;
+ var index = output.lastIndexOf('\n');
+ if (index !== -1) {
+ // There's something before the report JSON
+ // Log it to the console -- it's probably some debug output:
+ console.log(output.slice(0, index));
+ output = output.slice(index);
+ }
+ errors.push(report(testType, JSON.parse(output)));
}
if (errors.length === 2) {
done(!errors[0] && !errors[1]);
}
if (errors.length === 2) {
done(!errors[0] && !errors[1]);