Commit 1dd1dc3c authored by Iuri Matias's avatar Iuri Matias

track passing/failures for all the tests

parent cf62c35c
...@@ -39,6 +39,9 @@ var runTestFiles = function (filepath, isDirectory, web3) { ...@@ -39,6 +39,9 @@ var runTestFiles = function (filepath, isDirectory, web3) {
next(null, contractsToTest, contracts) next(null, contractsToTest, contracts)
}, },
function runTests (contractsToTest, contracts, next) { function runTests (contractsToTest, contracts, next) {
let totalPassing = 0
let totalFailing = 0
var testCallback = function (result) { var testCallback = function (result) {
if (result.type === 'contract') { if (result.type === 'contract') {
console.log('\n ' + result.value) console.log('\n ' + result.value)
...@@ -49,12 +52,8 @@ var runTestFiles = function (filepath, isDirectory, web3) { ...@@ -49,12 +52,8 @@ var runTestFiles = function (filepath, isDirectory, web3) {
} }
} }
var resultsCallback = function (_err, result, cb) { var resultsCallback = function (_err, result, cb) {
if (result.passingNum > 0) { totalPassing += result.passingNum
console.log((result.passingNum + ' passing').green) totalFailing += result.failureNum
}
if (result.failureNum > 0) {
console.log((result.failureNum + ' failing').red)
}
cb() cb()
} }
...@@ -65,7 +64,22 @@ var runTestFiles = function (filepath, isDirectory, web3) { ...@@ -65,7 +64,22 @@ var runTestFiles = function (filepath, isDirectory, web3) {
} }
resultsCallback(null, result, cb) resultsCallback(null, result, cb)
}) })
}, next) }, function(err, _results) {
if (err) {
return next(err)
}
console.log("\n")
if (totalPassing > 0) {
console.log((" " + totalPassing + ' passing').green)
}
if (totalFailing > 0) {
console.log((" " + totalFailing + ' failing').red)
}
console.log("")
next();
})
} }
], function () { ], function () {
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment