diff --git a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx
index c3f9adc852..5536f3d63e 100644
--- a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx
+++ b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx
@@ -1,7 +1,7 @@
import React, { useState, useRef, useEffect } from 'react' // eslint-disable-line
// import { TestTabLogic } from './logic/testTabLogic'
var async = require('async')
-var ReactDOM = require('react-dom');
+import { canUseWorker, urlFromVersion } from '@remix-project/remix-solidity'
import './css/style.css'
@@ -42,6 +42,7 @@ export const SolidityUnitTesting = (props: any) => {
let [runningTestsNumber, setRunningTestsNumber] = useState(0)
let [hasBeenStopped, setHasBeenStopped] = useState(false)
let [areTestsRunning, setAreTestsRunning] = useState(false)
+ let [isDebugging, setIsDebugging] = useState(false)
@@ -176,6 +177,234 @@ export const SolidityUnitTesting = (props: any) => {
setPathOptions(pathOptions)
}
+ const testCallback = (result, runningTests) => {
+ console.log('result---in testCallback->', result)
+ // this.testsOutput.hidden = false
+ // let debugBtn = yo``
+ // if ((result.type === 'testPass' || result.type === 'testFailure') && result.debugTxHash) {
+ // const { web3, debugTxHash } = result
+ // debugBtn = yo`
this.discardHighlight()}
+ // >
+ //
+ // ✓ ${result.value}
+ // ${debugBtn}
+ //
+ //
+ // `)
+ // } else if (result.type === 'testFailure') {
+ // if (result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value)
+ // if (!result.assertMethod) {
+ // this.testsOutput.appendChild(yo`
+ // this.highlightLocation(result.location, runningTests, result.filename)}
+ // >
+ //
+ // ✘ ${result.value}
+ // ${debugBtn}
+ //
+ //
Error Message:
+ //
"${result.errMsg}"
+ //
+ // `)
+ // } else {
+ // const preposition = result.assertMethod === 'equal' || result.assertMethod === 'notEqual' ? 'to' : ''
+ // const method = result.assertMethod === 'ok' ? '' : result.assertMethod
+ // const expected = result.assertMethod === 'ok' ? '\'true\'' : result.expected
+ // this.testsOutput.appendChild(yo`
+ // this.highlightLocation(result.location, runningTests, result.filename)}
+ // >
+ //
+ // ✘ ${result.value}
+ // ${debugBtn}
+ //
+ //
Error Message:
+ //
"${result.errMsg}"
+ //
Assertion:
+ //
+ //
Expected value should be
+ //
${method}
+ //
${preposition} ${expected}
+ //
+ //
Received value:
+ //
${result.returned}
+ //
Skipping the remaining tests of the function.
+ //
+ // `)
+ // }
+ // } else if (result.type === 'logOnly') {
+ // if (result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value)
+ // }
+ }
+
+ const resultsCallback = (_err, result, cb) => {
+ // total stats for the test
+ // result.passingNum
+ // result.failureNum
+ // result.timePassed
+ cb()
+ }
+
+ const updateFinalResult = (_errors, result, filename) => {
+ // ++this.readyTestsNumber
+ // this.testsOutput.hidden = false
+ // if (!result && (_errors && (_errors.errors || (Array.isArray(_errors) && (_errors[0].message || _errors[0].formattedMessage))))) {
+ // this.testCallback({ type: 'contract', filename })
+ // this.currentErrors = _errors.errors
+ // this.setHeader(false)
+ // }
+ // if (_errors && _errors.errors) {
+ // _errors.errors.forEach((err) => this.renderer.error(err.formattedMessage || err.message, this.testsOutput, { type: err.severity, errorType: err.type }))
+ // } else if (_errors && Array.isArray(_errors) && (_errors[0].message || _errors[0].formattedMessage)) {
+ // _errors.forEach((err) => this.renderer.error(err.formattedMessage || err.message, this.testsOutput, { type: err.severity, errorType: err.type }))
+ // } else if (_errors && !_errors.errors && !Array.isArray(_errors)) {
+ // // To track error like this: https://github.com/ethereum/remix/pull/1438
+ // this.renderer.error(_errors.formattedMessage || _errors.message, this.testsOutput, { type: 'error' })
+ // }
+ // yo.update(this.resultStatistics, this.createResultLabel())
+ // if (result) {
+ // const totalTime = parseFloat(result.totalTime).toFixed(2)
+
+ // if (result.totalPassing > 0 && result.totalFailing > 0) {
+ // this.testsOutput.appendChild(yo`
+ //