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
170fd31b
Commit
170fd31b
authored
May 25, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix web3 reference; catch errors
parent
e3865ee2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
testRunner.js
src/testRunner.js
+9
-2
No files found.
src/testRunner.js
View file @
170fd31b
...
@@ -36,6 +36,7 @@ function runTest (testName, testObject, testCallback, resultsCallback) {
...
@@ -36,6 +36,7 @@ function runTest (testName, testObject, testCallback, resultsCallback) {
let
passingNum
=
0
let
passingNum
=
0
let
failureNum
=
0
let
failureNum
=
0
let
timePassed
=
0
let
timePassed
=
0
let
web3
=
new
Web3
();
testCallback
({
type
:
'contract'
,
value
:
testName
})
testCallback
({
type
:
'contract'
,
value
:
testName
})
async
.
eachOfLimit
(
runList
,
1
,
function
(
func
,
index
,
next
)
{
async
.
eachOfLimit
(
runList
,
1
,
function
(
func
,
index
,
next
)
{
...
@@ -56,15 +57,16 @@ function runTest (testName, testObject, testCallback, resultsCallback) {
...
@@ -56,15 +57,16 @@ function runTest (testName, testObject, testCallback, resultsCallback) {
})
})
}
else
{
}
else
{
method
.
send
().
on
(
'receipt'
,
function
(
receipt
)
{
method
.
send
().
on
(
'receipt'
,
function
(
receipt
)
{
try
{
let
time
=
Math
.
ceil
((
Date
.
now
()
-
startTime
)
/
1000.0
)
let
time
=
Math
.
ceil
((
Date
.
now
()
-
startTime
)
/
1000.0
)
if
(
func
.
type
===
'test'
)
{
//
if (func.type === 'test') {
let
topic
=
Web3
.
utils
.
sha3
(
'AssertionEvent(bool,string)'
)
let
topic
=
Web3
.
utils
.
sha3
(
'AssertionEvent(bool,string)'
)
let
matchingEvents
=
[]
let
matchingEvents
=
[]
for
(
let
i
in
receipt
.
events
)
{
for
(
let
i
in
receipt
.
events
)
{
let
event
=
receipt
.
events
[
i
]
let
event
=
receipt
.
events
[
i
]
if
(
event
.
raw
.
topics
.
indexOf
(
topic
)
>=
0
)
{
if
(
event
.
raw
.
topics
.
indexOf
(
topic
)
>=
0
)
{
matchingEvents
.
push
(
W
eb3
.
eth
.
abi
.
decodeParameters
([
'bool'
,
'string'
],
event
.
raw
.
data
))
matchingEvents
.
push
(
w
eb3
.
eth
.
abi
.
decodeParameters
([
'bool'
,
'string'
],
event
.
raw
.
data
))
}
}
}
}
...
@@ -81,6 +83,11 @@ function runTest (testName, testObject, testCallback, resultsCallback) {
...
@@ -81,6 +83,11 @@ function runTest (testName, testObject, testCallback, resultsCallback) {
testCallback
({
type
:
'testFailure'
,
value
:
changeCase
.
sentenceCase
(
func
.
name
),
time
:
time
,
errMsg
:
result
[
1
],
context
:
testName
})
testCallback
({
type
:
'testFailure'
,
value
:
changeCase
.
sentenceCase
(
func
.
name
),
time
:
time
,
errMsg
:
result
[
1
],
context
:
testName
})
failureNum
+=
1
failureNum
+=
1
}
}
//}
}
catch
(
err
)
{
console
.
log
(
"error!"
);
console
.
dir
(
err
);
return
next
(
err
)
}
}
next
()
next
()
}).
on
(
'error'
,
function
(
err
)
{
}).
on
(
'error'
,
function
(
err
)
{
...
...
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