Commit 4eddeaa4 authored by aniket-engg's avatar aniket-engg Committed by Aniket

log formatting

parent c31a7f0d
...@@ -181,7 +181,7 @@ module.exports = class TestTab extends ViewPlugin { ...@@ -181,7 +181,7 @@ module.exports = class TestTab extends ViewPlugin {
} }
printHHLogs (logsArr, testName) { printHHLogs (logsArr, testName) {
let finalLogs = `${testName}:-\n` let finalLogs = `<b>${testName}:</b>\n`
for (const log of logsArr) { for (const log of logsArr) {
let formattedLog let formattedLog
// Hardhat implements the same formatting options that can be found in Node.js' console.log, // Hardhat implements the same formatting options that can be found in Node.js' console.log,
...@@ -193,7 +193,7 @@ module.exports = class TestTab extends ViewPlugin { ...@@ -193,7 +193,7 @@ module.exports = class TestTab extends ViewPlugin {
} else { } else {
formattedLog = log.join(' ') formattedLog = log.join(' ')
} }
finalLogs = finalLogs + formattedLog + '\n' finalLogs = finalLogs + '&emsp;' + formattedLog + '\n'
} }
this.call('terminal', 'log', { type: 'info', value: finalLogs }) this.call('terminal', 'log', { type: 'info', value: finalLogs })
} }
...@@ -216,7 +216,7 @@ module.exports = class TestTab extends ViewPlugin { ...@@ -216,7 +216,7 @@ module.exports = class TestTab extends ViewPlugin {
` `
this.testsOutput.appendChild(this.outputHeader) this.testsOutput.appendChild(this.outputHeader)
} else if (result.type === 'testPass') { } else if (result.type === 'testPass') {
if(result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value) if (result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value)
this.testsOutput.appendChild(yo` this.testsOutput.appendChild(yo`
<div <div
id="${this.runningTestFileName}" id="${this.runningTestFileName}"
...@@ -228,7 +228,7 @@ module.exports = class TestTab extends ViewPlugin { ...@@ -228,7 +228,7 @@ module.exports = class TestTab extends ViewPlugin {
</div> </div>
`) `)
} else if (result.type === 'testFailure') { } else if (result.type === 'testFailure') {
if(result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value) if (result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value)
if (!result.assertMethod) { if (!result.assertMethod) {
this.testsOutput.appendChild(yo` this.testsOutput.appendChild(yo`
<div <div
......
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