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
0dcd0957
Unverified
Commit
0dcd0957
authored
Sep 06, 2019
by
yann300
Committed by
GitHub
Sep 06, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1277 from andremedeiros/fix-test-reporter
Update test runner to report accounts via callback
parents
80f1a9ac
5783e74f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
11 deletions
+8
-11
package.json
remix-tests/package.json
+0
-1
testRunner.ts
remix-tests/src/testRunner.ts
+8
-10
testRunner.ts
remix-tests/tests/testRunner.ts
+0
-0
No files found.
remix-tests/package.json
View file @
0dcd0957
...
@@ -45,7 +45,6 @@
...
@@ -45,7 +45,6 @@
"remix-lib"
:
"0.4.12"
,
"remix-lib"
:
"0.4.12"
,
"remix-simulator"
:
"0.1.9-alpha.5"
,
"remix-simulator"
:
"0.1.9-alpha.5"
,
"remix-solidity"
:
"0.3.15"
,
"remix-solidity"
:
"0.3.15"
,
"signale"
:
"^1.2.1"
,
"web3"
:
"1.0.0-beta.36"
,
"web3"
:
"1.0.0-beta.36"
,
"winston"
:
"^3.0.0"
"winston"
:
"^3.0.0"
},
},
...
...
remix-tests/src/testRunner.ts
View file @
0dcd0957
...
@@ -62,15 +62,13 @@ export function runTest (testName, testObject: any, contractDetails: any, opts:
...
@@ -62,15 +62,13 @@ export function runTest (testName, testObject: any, contractDetails: any, opts:
let
timePassed
:
number
=
0
let
timePassed
:
number
=
0
let
web3
=
new
Web3
()
let
web3
=
new
Web3
()
const
userAgent
=
(
typeof
(
navigator
)
!==
'undefined'
)
&&
navigator
.
userAgent
?
navigator
.
userAgent
.
toLowerCase
()
:
'-'
const
accts
:
TestResultInterface
=
{
const
isBrowser
=
!
(
typeof
(
window
)
===
'undefined'
||
userAgent
.
indexOf
(
' electron/'
)
>
-
1
)
type
:
'accountList'
,
if
(
!
isBrowser
)
{
value
:
opts
.
accounts
let
signale
=
require
(
'signale'
)
signale
.
warn
(
'DO NOT TRY TO ACCESS (IN YOUR SOLIDITY TEST) AN ACCOUNT GREATER THAN THE LENGTH OF THE FOLLOWING ARRAY ('
+
opts
.
accounts
.
length
+
') :'
)
signale
.
warn
(
opts
.
accounts
)
signale
.
warn
(
'e.g: the following code won
\'
t work in the current context:'
)
signale
.
warn
(
'TestsAccounts.getAccount('
+
opts
.
accounts
.
length
+
')'
)
}
}
testCallback
(
undefined
,
accts
);
const
resp
:
TestResultInterface
=
{
const
resp
:
TestResultInterface
=
{
type
:
'contract'
,
type
:
'contract'
,
value
:
testName
,
value
:
testName
,
...
@@ -93,7 +91,7 @@ export function runTest (testName, testObject: any, contractDetails: any, opts:
...
@@ -93,7 +91,7 @@ export function runTest (testName, testObject: any, contractDetails: any, opts:
let
startTime
=
Date
.
now
()
let
startTime
=
Date
.
now
()
if
(
func
.
constant
)
{
if
(
func
.
constant
)
{
method
.
call
(
sendParams
).
then
((
result
)
=>
{
method
.
call
(
sendParams
).
then
((
result
)
=>
{
let
time
=
Math
.
ceil
((
Date
.
now
()
-
startTime
)
/
1000.0
)
let
time
=
(
Date
.
now
()
-
startTime
)
/
1000.0
if
(
result
)
{
if
(
result
)
{
const
resp
:
TestResultInterface
=
{
const
resp
:
TestResultInterface
=
{
type
:
'testPass'
,
type
:
'testPass'
,
...
@@ -120,7 +118,7 @@ export function runTest (testName, testObject: any, contractDetails: any, opts:
...
@@ -120,7 +118,7 @@ export function runTest (testName, testObject: any, contractDetails: any, opts:
}
else
{
}
else
{
method
.
send
(
sendParams
).
on
(
'receipt'
,
(
receipt
)
=>
{
method
.
send
(
sendParams
).
on
(
'receipt'
,
(
receipt
)
=>
{
try
{
try
{
let
time
:
number
=
Math
.
ceil
((
Date
.
now
()
-
startTime
)
/
1000.0
)
let
time
:
number
=
(
Date
.
now
()
-
startTime
)
/
1000.0
let
topic
=
Web3
.
utils
.
sha3
(
'AssertionEvent(bool,string)'
)
let
topic
=
Web3
.
utils
.
sha3
(
'AssertionEvent(bool,string)'
)
let
testPassed
:
boolean
=
false
let
testPassed
:
boolean
=
false
...
...
remix-tests/tests/testRunner.ts
View file @
0dcd0957
This diff is collapsed.
Click to expand it.
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