debug button

pull/5370/head
Aniket-Engg 3 years ago committed by Aniket
parent 59a2356723
commit ecf8057b34
  1. 31
      libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx

@ -186,17 +186,24 @@ export const SolidityUnitTesting = (props: any) => {
return fileName ? fileName.replace(/\//g, '_').replace(/\./g, '_') + testSuite : fileName return fileName ? fileName.replace(/\//g, '_').replace(/\./g, '_') + testSuite : fileName
} }
const startDebug = async (txHash: any, web3: any) => {
// this.isDebugging = true
if (!await testTab.appManager.isActive('debugger')) await testTab.appManager.activatePlugin('debugger')
testTab.call('menuicons', 'select', 'debugger')
testTab.call('debugger', 'debug', txHash, web3)
}
const testCallback = (result: any, runningTests: any) => { const testCallback = (result: any, runningTests: any) => {
console.log('result---in testCallback->', result) console.log('result---in testCallback->', result)
// this.testsOutput.hidden = false let debugBtn
// let debugBtn = yo`` if ((result.type === 'testPass' || result.type === 'testFailure') && result.debugTxHash) {
// if ((result.type === 'testPass' || result.type === 'testFailure') && result.debugTxHash) { const { web3, debugTxHash } = result
// const { web3, debugTxHash } = result debugBtn = (
// debugBtn = yo`<div id=${result.value.replaceAll(' ', '_')} class="btn border btn btn-sm ml-1" title="Start debugging" onclick=${() => this.startDebug(debugTxHash, web3)}> <div id={result.value.replaceAll(' ', '_')} className="btn border btn btn-sm ml-1" style={{ cursor: 'pointer' }} title="Start debugging" onClick={() => startDebug(debugTxHash, web3)}>
// <i class="fas fa-bug"></i> <i className="fas fa-bug"></i>
// </div>` </div>
// debugBtn.style.cursor = 'pointer' )
// } }
if (result.type === 'contract') { if (result.type === 'contract') {
var testSuite = result.value var testSuite = result.value
if (testSuites) { if (testSuites) {
@ -222,7 +229,7 @@ export const SolidityUnitTesting = (props: any) => {
> >
<div className="d-flex my-1 align-items-start justify-content-between"> <div className="d-flex my-1 align-items-start justify-content-between">
<span > {result.value}</span> <span > {result.value}</span>
{/* ${debugBtn} */} {debugBtn}
</div> </div>
</div> </div>
) )
@ -237,7 +244,7 @@ export const SolidityUnitTesting = (props: any) => {
> >
<div className="d-flex my-1 align-items-start justify-content-between"> <div className="d-flex my-1 align-items-start justify-content-between">
<span> {result.value}</span> <span> {result.value}</span>
{/* ${debugBtn} */} {debugBtn}
</div> </div>
<span className="text-dark">Error Message:</span> <span className="text-dark">Error Message:</span>
<span className="pb-2 text-break">"{result.errMsg}"</span> <span className="pb-2 text-break">"{result.errMsg}"</span>
@ -254,7 +261,7 @@ export const SolidityUnitTesting = (props: any) => {
> >
<div className="d-flex my-1 align-items-start justify-content-between"> <div className="d-flex my-1 align-items-start justify-content-between">
<span> {result.value}</span> <span> {result.value}</span>
{/* ${debugBtn} */} {debugBtn}
</div> </div>
<span className="text-dark">Error Message:</span> <span className="text-dark">Error Message:</span>
<span className="pb-2 text-break">"{result.errMsg}"</span> <span className="pb-2 text-break">"{result.errMsg}"</span>

Loading…
Cancel
Save