grunt.until.spawn impl causing issue
Opened this issue · 2 comments
pearsop commented
file: tasks/index.js
line #: 324
problem: the err object returned by the callback is defined as object with no keys. Therefore, should change the if statement from if(err) { to if (Object.keys(err).length>0) {
if (!options.dryRun) {
grunt.util.spawn({
cmd: options.nodeExec,
args: args,
opts: {
env: process.env,
cwd: options.cwd,
stdio: options.quiet ? 'ignore' : 'inherit'
}
}, function (err, result) {
console.log('Error is:'+JSON.stringify(err));
if (err) {
grunt.log.error(result);
done(false);
return;
}
pocesar commented
I didn't understand the problem, could you rewrite your OP please?
pearsop commented
Original problem is that setting the options.check thresholds were not working in the grunt file like so
mocha_istanbul: {
coverage: {
src: ['test/unit'], // multiple folders also works
options: {
coverage: true, // this will cause grunt.event.on('coverage') event listener to fire
coverageFolder: 'reports',
check: {
lines: 90,
statements: 90,
functions: 90,
branches: 80
From: "Pearson, Patrick" <pearsop@amazon.com>
Date: Tuesday, August 22, 2017 at 5:03 PM
To: pocesar/grunt-mocha-istanbul <reply@reply.github.com>, pocesar/grunt-mocha-istanbul <grunt-mocha-istanbul@noreply.github.com>
Cc: Author <author@noreply.github.com>
Subject: Re: [pocesar/grunt-mocha-istanbul] grunt.until.spawn impl causing issue (#70)
Hi,
Will try to explain the issue that I’m seeing the tasks/index.js file in this git project.
Line 324 of grunt-mocha-instanbul/tasks.index.js is checking if(err) which appears not to be 100% correct. Check the doneFunction for gunt.util.spawn specs as it returns an object for the error and the object happens to have empty properties which I assume means no error. So the err object will always be something and not null.
https://gruntjs.com/api/grunt.util
Patrick
From: Paulo Cesar <notifications@github.com>
Reply-To: pocesar/grunt-mocha-istanbul <reply@reply.github.com>
Date: Tuesday, August 22, 2017 at 4:35 PM
To: pocesar/grunt-mocha-istanbul <grunt-mocha-istanbul@noreply.github.com>
Cc: "Pearson, Patrick" <pearsop@amazon.com>, Author <author@noreply.github.com>
Subject: Re: [pocesar/grunt-mocha-istanbul] grunt.until.spawn impl causing issue (#70)
I didn't understand the problem, could you rewrite your OP please?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#70 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AdzsxTCalp5WqBaBhmXnt0ZLeT3FyM_Jks5sazutgaJpZM4O_DiG>.