diff --git a/src/app/tabs/test-tab.js b/src/app/tabs/test-tab.js
index d759f3e278..9b8e60d319 100644
--- a/src/app/tabs/test-tab.js
+++ b/src/app/tabs/test-tab.js
@@ -2,40 +2,44 @@ var yo = require('yo-yo')
var css = require('./styles/test-tab-styles')
var remixTests = require('remix-tests')
+function append (container, txt) {
+ let child = yo`
${txt}
`
+ container.appendChild(child)
+}
+
function testTabView (api) {
+ var container = yo``
+
let testCallback = function (result) {
if (result.type === 'contract') {
- console.log('\n ' + result.value)
+ append(container, '\n ' + result.value)
} else if (result.type === 'testPass') {
- console.log('\t✓ ' + result.value)
+ append(container, '\t✓ ' + result.value)
} else if (result.type === 'testFailure') {
- console.log('\t✘ ' + result.value)
+ append(container, '\t✘ ' + result.value)
}
}
let resultsCallback = function (_err, result, cb) {
- console.dir(result)
- console.dir('testName ' + result.context)
- console.dir(result.passingNum)
- console.dir(result.failureNum)
- console.dir(result.timePassed)
+ // total stats for the test
+ // result.passingNum
+ // result.failureNum
+ // result.timePassed
cb()
}
let finalCallback = function (_err, result) {
- console.dir('finalCallback')
-
if (result.totalPassing > 0) {
- console.log((' ' + result.totalPassing + ' passing ') + ('(' + result.totalTime + 's)'))
+ append(container, (' ' + result.totalPassing + ' passing ') + ('(' + result.totalTime + 's)'))
}
if (result.totalFailing > 0) {
- console.log((' ' + result.totalFailing + ' failing'))
+ append(container, (' ' + result.totalFailing + ' failing'))
}
result.errors.forEach((error, index) => {
- console.log(' ' + (index + 1) + ') ' + error.context + ' ' + error.value)
- console.log('')
- console.log(('\t error: ' + error.message))
+ append(container, ' ' + (index + 1) + ') ' + error.context + ' ' + error.value)
+ append(container, '')
+ append(container, ('\t error: ' + error.message))
})
}
@@ -53,6 +57,7 @@ function testTabView (api) {
`