Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
6a5ab530
Commit
6a5ab530
authored
Apr 27, 2020
by
ioedeveloper
Committed by
Liana Husikyan
Apr 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display filename for Errored testfile
parent
e878569d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
test-tab.js
src/app/tabs/test-tab.js
+16
-13
No files found.
src/app/tabs/test-tab.js
View file @
6a5ab530
...
...
@@ -154,13 +154,13 @@ module.exports = class TestTab extends ViewPlugin {
return
fileName
?
fileName
.
replace
(
/
\/
/g
,
'_'
).
replace
(
/
\.
/g
,
'_'
)
:
fileName
}
update
Header
(
status
)
{
set
Header
(
status
)
{
if
(
status
)
{
const
label
=
yo
`<
span class="alert-success mr-1 p-1 passed_
${
this
.
runningTestFileName
}
">PASS</span
>`
const
label
=
yo
`<
div class="alert-success d-inline-block mb-1 mr-1 p-1 passed_
${
this
.
runningTestFileName
}
">PASS</div
>`
this
.
outputHeader
&&
yo
.
update
(
this
.
outputHeader
,
yo
`<div class="
${
css
.
outputTitle
}
">
${
label
}
${
this
.
testSuite
}
<br />
${
this
.
rawFileName
}
</div>`
)
}
else
{
const
label
=
yo
`<
span class="alert-danger mr-1 p-1 failed_
${
this
.
runningTestFileName
}
">FAIL</span
>`
const
label
=
yo
`<
div class="alert-danger d-inline-block mb-1 mr-1 p-1 failed_
${
this
.
runningTestFileName
}
">FAIL</div
>`
this
.
outputHeader
&&
yo
.
update
(
this
.
outputHeader
,
yo
`<div class="
${
css
.
outputTitle
}
">
${
label
}
${
this
.
testSuite
}
<br />
${
this
.
rawFileName
}
</div>`
)
}
...
...
@@ -168,33 +168,36 @@ module.exports = class TestTab extends ViewPlugin {
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
.
setHeader
(
false
)
}
if
(
_errors
&&
_errors
.
errors
)
{
_errors
.
errors
.
forEach
((
err
)
=>
this
.
renderer
.
error
(
err
.
formattedMessage
||
err
.
message
,
this
.
testsOutput
,
{
type
:
err
.
severity
}))
this
.
updateHeader
(
false
)
}
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
}))
this
.
updateHeader
(
false
)
}
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'
})
this
.
updateHeader
(
false
)
}
yo
.
update
(
this
.
resultStatistics
,
this
.
createResultLabel
())
if
(
result
)
{
if
(
result
.
totalPassing
>
0
&&
result
.
totalFailing
>
0
)
{
this
.
testsOutput
.
appendChild
(
yo
`<div class="text-success">
${
result
.
totalPassing
}
passing, <span class="text-danger">
${
result
.
totalFailing
}
failing </span> (
${
result
.
totalTime
}
s)</div>`
)
this
.
update
Header
(
false
)
if
(
this
.
rawFileName
===
filename
)
this
.
set
Header
(
false
)
}
else
if
(
result
.
totalPassing
>
0
&&
result
.
totalFailing
<=
0
)
{
this
.
testsOutput
.
appendChild
(
yo
`<div class="text-success">
${
result
.
totalPassing
}
passing (
${
result
.
totalTime
}
s)</div>`
)
this
.
update
Header
(
true
)
if
(
this
.
rawFileName
===
filename
)
this
.
set
Header
(
true
)
}
else
if
(
result
.
totalPassing
<=
0
&&
result
.
totalFailing
>
0
)
{
this
.
testsOutput
.
appendChild
(
yo
`<div class="text-danger">
${
result
.
totalFailing
}
failing</div>`
)
this
.
update
Header
(
false
)
if
(
this
.
rawFileName
===
filename
)
this
.
set
Header
(
false
)
}
result
.
errors
.
forEach
((
error
,
index
)
=>
{
this
.
testsOutput
.
appendChild
(
yo
`<ul type="disc" class="ml-3 mb-0"><li class="text-danger">
${
error
.
value
}
</li></ul>`
)
this
.
testsOutput
.
appendChild
(
yo
`<div class="
${
css
.
testFailureSummary
}
"><span>Error:</span><br /><span class="text-danger ml-2">
${
error
.
message
}
</span></div>`
)
this
.
testsOutput
.
appendChild
(
yo
`<br>`
)
this
.
testsOutput
.
appendChild
(
yo
`<div class="sol error alert alert-danger">
<ul type="disc" class="ml-3 mb-0"><li>
${
error
.
value
}
</li></ul>
<span class="text-danger ml-3">
${
error
.
message
}
</span>
</div>`
)
})
}
if
(
this
.
hasBeenStopped
&&
(
this
.
readyTestsNumber
!==
this
.
runningTestsNumber
))
{
...
...
@@ -410,7 +413,7 @@ module.exports = class TestTab extends ViewPlugin {
render () {
this.onActivationInternal()
this.testsOutput = yo`
<
div
class
=
"mx-3 border-top border-bottom border-primary"
hidden
=
'true'
id
=
"solidityUnittestsOutput"
data
-
id
=
"testTabSolidityUnitTestsOutput"
><
/a>
`
this.testsOutput = yo`
<
div
class
=
"mx-3
mb-2
border-top border-bottom border-primary"
hidden
=
'true'
id
=
"solidityUnittestsOutput"
data
-
id
=
"testTabSolidityUnitTestsOutput"
><
/a>
`
this
.
testsExecutionStopped
=
yo
`<label class="text-warning h6">The test execution has been stopped</label>`
this
.
testsExecutionStopped
.
hidden
=
true
this
.
resultStatistics
=
this
.
createResultLabel
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment