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
6c147a78
Unverified
Commit
6c147a78
authored
May 31, 2018
by
yann300
Committed by
GitHub
May 31, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8 from ethereum/export_assert_lib
Export assert lib
parents
170fd31b
45916fe9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
tests.sol.js
sol/tests.sol.js
+2
-1
compiler.js
src/compiler.js
+6
-1
index.js
src/index.js
+2
-1
No files found.
sol/tests.sol
→
sol/tests.sol
.js
View file @
6c147a78
module
.
exports
=
`
pragma solidity ^0.4.7;
pragma solidity ^0.4.7;
library Assert {
library Assert {
...
@@ -99,4 +100,4 @@ library Assert {
...
@@ -99,4 +100,4 @@ library Assert {
//}
//}
}
}
`
;
src/compiler.js
View file @
6c147a78
...
@@ -10,7 +10,8 @@ function compileFileOrFiles (filename, isDirectory, cb) {
...
@@ -10,7 +10,8 @@ function compileFileOrFiles (filename, isDirectory, cb) {
let
compiler
,
filepath
let
compiler
,
filepath
const
sources
=
{
const
sources
=
{
'tests.sol'
:
{
content
:
fs
.
readFileSync
(
'sol/tests.sol'
).
toString
()}
'tests.sol'
:
{
content
:
require
(
'../sol/tests.sol.js'
)
},
'remix_tests.sol'
:
{
content
:
require
(
'../sol/tests.sol.js'
)
}
}
}
// TODO: for now assumes filepath dir contains all tests, later all this
// TODO: for now assumes filepath dir contains all tests, later all this
...
@@ -48,6 +49,10 @@ function compileFileOrFiles (filename, isDirectory, cb) {
...
@@ -48,6 +49,10 @@ function compileFileOrFiles (filename, isDirectory, cb) {
function
compileContractSources
(
sources
,
cb
)
{
function
compileContractSources
(
sources
,
cb
)
{
let
compiler
,
filepath
let
compiler
,
filepath
if
(
!
sources
[
'remix_tests.sol'
])
{
sources
[
'remix_tests.sol'
]
=
{
content
:
require
(
'../sol/tests.sol.js'
)}
}
async
.
waterfall
([
async
.
waterfall
([
function
loadCompiler
(
next
)
{
function
loadCompiler
(
next
)
{
compiler
=
new
RemixCompiler
()
compiler
=
new
RemixCompiler
()
...
...
src/index.js
View file @
6c147a78
...
@@ -188,5 +188,6 @@ var runTestFiles = function (filepath, isDirectory, web3) {
...
@@ -188,5 +188,6 @@ var runTestFiles = function (filepath, isDirectory, web3) {
module
.
exports
=
{
module
.
exports
=
{
runTestFiles
:
runTestFiles
,
runTestFiles
:
runTestFiles
,
runTestSources
:
runTestSources
,
runTestSources
:
runTestSources
,
runTest
:
TestRunner
.
runTest
runTest
:
TestRunner
.
runTest
,
assertLibCode
:
require
(
'../sol/tests.sol.js'
)
}
}
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