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
0379528f
Commit
0379528f
authored
Feb 07, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update tests
parent
e7aec5de
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
testRunner.js
tests/testRunner.js
+10
-8
No files found.
tests/testRunner.js
View file @
0379528f
...
@@ -18,18 +18,20 @@ function compileAndDeploy (filename, callback) {
...
@@ -18,18 +18,20 @@ function compileAndDeploy (filename, callback) {
Deployer
.
deployAll
(
compilationResult
,
web3
,
next
)
Deployer
.
deployAll
(
compilationResult
,
web3
,
next
)
}
}
],
function
(
_err
,
contracts
)
{
],
function
(
_err
,
contracts
)
{
callback
(
null
,
contracts
)
callback
(
null
,
contracts
,
web3
)
})
})
}
}
describe
(
'testRunner'
,
function
()
{
describe
(
'testRunner'
,
function
()
{
let
web3
;
describe
(
'#runTest'
,
function
()
{
describe
(
'#runTest'
,
function
()
{
describe
(
'test with beforeAll'
,
function
()
{
describe
(
'test with beforeAll'
,
function
()
{
let
filename
=
'tests/examples_1/simple_storage_test.sol'
let
filename
=
'tests/examples_1/simple_storage_test.sol'
let
tests
=
[],
results
=
{}
let
tests
=
[],
results
=
{}
before
(
function
(
done
)
{
before
(
function
(
done
)
{
compileAndDeploy
(
filename
,
function
(
_err
,
contracts
)
{
compileAndDeploy
(
filename
,
function
(
_err
,
contracts
,
_web3
)
{
web3
=
_web3
;
var
testCallback
=
function
(
test
)
{
var
testCallback
=
function
(
test
)
{
tests
.
push
(
test
)
tests
.
push
(
test
)
}
}
...
@@ -37,7 +39,7 @@ describe('testRunner', function () {
...
@@ -37,7 +39,7 @@ describe('testRunner', function () {
results
=
_results
results
=
_results
done
()
done
()
}
}
TestRunner
.
runTest
(
'MyTest'
,
contracts
.
MyTest
,
testCallback
,
resultsCallback
)
TestRunner
.
runTest
(
web3
,
'MyTest'
,
contracts
.
MyTest
,
testCallback
,
resultsCallback
)
})
})
})
})
...
@@ -52,8 +54,8 @@ describe('testRunner', function () {
...
@@ -52,8 +54,8 @@ describe('testRunner', function () {
it
(
'should returns 3 messages'
,
function
()
{
it
(
'should returns 3 messages'
,
function
()
{
assert
.
deepEqual
(
tests
,
[
assert
.
deepEqual
(
tests
,
[
{
type
:
'contract'
,
value
:
'MyTest'
},
{
type
:
'contract'
,
value
:
'MyTest'
},
{
type
:
'testPass'
,
value
:
'Initial value should be100'
,
time
:
1
},
{
type
:
'testPass'
,
value
:
'Initial value should be100'
,
time
:
1
,
context
:
'MyTest'
},
{
type
:
'testFailure'
,
value
:
'Initial value should be200'
,
time
:
1
}
{
type
:
'testFailure'
,
value
:
'Initial value should be200'
,
time
:
1
,
context
:
'MyTest'
,
errMsg
:
'function returned false'
}
])
])
})
})
})
})
...
@@ -71,7 +73,7 @@ describe('testRunner', function () {
...
@@ -71,7 +73,7 @@ describe('testRunner', function () {
results
=
_results
results
=
_results
done
()
done
()
}
}
TestRunner
.
runTest
(
'MyTest'
,
contracts
.
MyTest
,
testCallback
,
resultsCallback
)
TestRunner
.
runTest
(
web3
,
'MyTest'
,
contracts
.
MyTest
,
testCallback
,
resultsCallback
)
})
})
})
})
...
@@ -86,8 +88,8 @@ describe('testRunner', function () {
...
@@ -86,8 +88,8 @@ describe('testRunner', function () {
it
(
'should returns 3 messages'
,
function
()
{
it
(
'should returns 3 messages'
,
function
()
{
assert
.
deepEqual
(
tests
,
[
assert
.
deepEqual
(
tests
,
[
{
type
:
'contract'
,
value
:
'MyTest'
},
{
type
:
'contract'
,
value
:
'MyTest'
},
{
type
:
'testPass'
,
value
:
'Initial value should be100'
,
time
:
1
},
{
type
:
'testPass'
,
value
:
'Initial value should be100'
,
time
:
1
,
context
:
'MyTest'
},
{
type
:
'testPass'
,
value
:
'Initial value should be200'
,
time
:
1
}
{
type
:
'testPass'
,
value
:
'Initial value should be200'
,
time
:
1
,
context
:
'MyTest'
}
])
])
})
})
})
})
...
...
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