Need help with a question that's part of our project presentation.
We are working on controlling the output of KARATE, ensuring it returns an OK or a KO depending on the test result. Currently, it always gives back 0
regardless of success or failure..
This is a function we're dealing with:
karate.executable = function () {
let prefix = karate.config.dir ? '-Dkarate.config.dir=' + karate.config.dir + ' ' : '';
return prefix + 'com.intuit.karate:karate-core:' + karate.version + ':all';
};
karate.exec = function (args) {
if (!args) {
var args = process.argv.slice(2).join(' ');
console.log("ARGUMENT " + args)
}
process.env['KARATE_META'] = 'npm:' + process.env.npm_package_version;
var error = jbang.exec(karate.executable() + ' ' + args);
console.log("OUT " + error)
};
module.exports = karate;
Tried modifying the function but encountered errors.
Expecting the karate.exec to provide a return value of 1 for test failures and 0 for successful tests.