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
089b9a76
Commit
089b9a76
authored
Sep 03, 2020
by
LianaHus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
displaying expected vs received values for unit testing test case
parent
0ea9e1dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
test-tab.js
apps/remix-ide/src/app/tabs/test-tab.js
+11
-7
No files found.
apps/remix-ide/src/app/tabs/test-tab.js
View file @
089b9a76
...
...
@@ -144,24 +144,28 @@ module.exports = class TestTab extends ViewPlugin {
this
.
testsOutput
.
appendChild
(
this
.
outputHeader
)
}
else
if
(
result
.
type
===
'testPass'
)
{
this
.
testsOutput
.
appendChild
(
yo
`
<div id="
${
this
.
runningTestFileName
}
" data-id="testTabSolidityUnitTestsOutputheader" class="
${
css
.
testPass
}
${
css
.
testLog
}
text-success border-0">
<div id="
${
this
.
runningTestFileName
}
" data-id="testTabSolidityUnitTestsOutputheader" class="
bg-light mb-2
${
css
.
testPass
}
${
css
.
testLog
}
text-success border-0">
✓
${
result
.
value
}
</div>
`
)
}
else
if
(
result
.
type
===
'testFailure'
)
{
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
`
<div class="
${
css
.
testFailure
}
${
css
.
testLog
}
d-flex flex-column text-danger border-0" id="UTContext
${
result
.
context
}
">
<div class="
bg-light mb-2
${
css
.
testFailure
}
${
css
.
testLog
}
d-flex flex-column text-danger border-0" id="UTContext
${
result
.
context
}
">
<span> ✘
${
result
.
value
}
</span>
<span class="text-dark">Error Message:</span>
<span class="pb-2">"
${
result
.
errMsg
}
"</span>
<span class="text-dark">Asserttion:</span>
<div class="d-flex flex-wrap">
<span>
The value should be </div
>
<div class="
px-1 font-weight-bold">'
${
result
.
assertMethod
}
'
</div>
<div>
(to):
${
result
.
expected
}
</div>
<span>
Expected value should be</span
>
<div class="
mx-1 font-weight-bold">
${
method
}
</div>
<div>
${
preposition
}
${
expected
}
</div>
</div>
<span class="text-dark">The result is:</span>
<span>
${
result
.
returned
}
</span>
<span class="text-dark">Received value:</span>
<span>
${
result
.
returned
}
</span>
<span class="text-dark text-sm pb-2">Skipping the rest...</span>
</div>
`
)
}
...
...
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