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
b690e2b8
Commit
b690e2b8
authored
Feb 06, 2019
by
Sab94
Committed by
0mkar
Mar 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename fs.ts
parent
a74d96fa
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
56 deletions
+54
-56
remix-tests
remix-tests/bin/remix-tests
+1
-1
compiler.ts
remix-tests/src/compiler.ts
+1
-1
fileSystem.ts
remix-tests/src/fileSystem.ts
+13
-15
run.ts
remix-tests/src/run.ts
+36
-36
runTestFiles.ts
remix-tests/src/runTestFiles.ts
+3
-3
No files found.
remix-tests/bin/remix-tests
View file @
b690e2b8
#!/usr/bin/env node
require
(
'../
src
/run.js'
);
require
(
'../
dist
/run.js'
);
remix-tests/src/compiler.ts
View file @
b690e2b8
/* eslint no-extend-native: "warn" */
let
fs
=
require
(
'.
./src/fs
'
)
let
fs
=
require
(
'.
/fileSystem
'
)
var
async
=
require
(
'async'
)
var
path
=
require
(
'path'
)
let
RemixCompiler
=
require
(
'remix-solidity'
).
Compiler
...
...
remix-tests/src/f
s.j
s
→
remix-tests/src/f
ileSystem.t
s
View file @
b690e2b8
// Extend fs
var
fs
=
require
(
'fs'
)
let
fs
:
any
=
require
(
'fs'
)
const
path
=
require
(
'path'
)
// https://github.com/mikeal/node-utils/blob/master/file/lib/main.js
fs
.
walkSync
=
function
(
start
,
callback
)
{
fs
.
readdirSync
(
start
).
forEach
(
name
=>
{
if
(
name
===
'node_modules'
)
{
return
// hack
}
var
abspath
=
path
.
join
(
start
,
name
)
if
(
fs
.
statSync
(
abspath
).
isDirectory
())
{
fs
.
walkSync
(
abspath
,
callback
)
}
else
{
callback
(
abspath
)
}
})
fs
.
readdirSync
(
start
).
forEach
(
name
=>
{
if
(
name
===
'node_modules'
)
{
return
// hack
}
var
abspath
=
path
.
join
(
start
,
name
)
if
(
fs
.
statSync
(
abspath
).
isDirectory
())
{
fs
.
walkSync
(
abspath
,
callback
)
}
else
{
callback
(
abspath
)
}
})
}
module
.
exports
=
fs
\ No newline at end of file
export
=
fs
remix-tests/src/run.
j
s
→
remix-tests/src/run.
t
s
View file @
b690e2b8
const
commander
=
require
(
'commander'
)
const
Web3
=
require
(
'web3'
)
const
RemixTests
=
require
(
'./index.js'
)
const
fs
=
require
(
'fs
'
)
import
runTestFiles
from
'./runTestFiles'
import
fs
=
require
(
'./fileSystem
'
)
const
Provider
=
require
(
'remix-simulator'
).
Provider
const
{
Log
}
=
require
(
'./logger'
)
import
Log
=
require
(
'./logger'
)
const
logger
=
new
Log
()
const
log
=
logger
.
logger
require
(
'colors'
)
// parse verbosity
function
mapVerbosity
(
v
)
{
const
levels
=
{
0
:
'error'
,
1
:
'warn'
,
2
:
'info'
,
3
:
'verbose'
,
4
:
'debug'
,
5
:
'silly'
}
return
levels
[
v
]
const
levels
=
{
0
:
'error'
,
1
:
'warn'
,
2
:
'info'
,
3
:
'verbose'
,
4
:
'debug'
,
5
:
'silly'
}
return
levels
[
v
]
}
const
version
=
require
(
'../package.json'
).
version
commander
.
version
(
version
)
commander
.
command
(
'version'
).
description
(
'output the version number'
).
action
(
function
()
{
console
.
log
(
version
)
console
.
log
(
version
)
})
commander
.
command
(
'help'
).
description
(
'output usage information'
).
action
(
function
()
{
commander
.
help
()
commander
.
help
()
})
// get current version
commander
.
option
(
'-v, --verbose <level>'
,
'run with verbosity'
,
mapVerbosity
)
.
action
(
function
(
filename
)
{
// Console message
console
.
log
((
'
\
n
\
t👁 :: Running remix-tests - Unit testing for solidity :: 👁
\
t
\
n'
).
white
)
// set logger verbosity
if
(
commander
.
verbose
)
{
logger
.
setVerbosity
(
commander
.
verbose
)
log
.
info
(
'verbosity level set to '
+
commander
.
verbose
.
blue
)
}
let
web3
=
new
Web3
()
// web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'))
web3
.
setProvider
(
new
Provider
())
// web3.setProvider(new web3.providers.WebsocketProvider('ws://localhost:8546'))
.
option
(
'-v, --verbose <level>'
,
'run with verbosity'
,
mapVerbosity
)
.
action
(
function
(
filename
)
{
// Console message
console
.
log
((
'
\
n
\
t👁 :: Running remix-tests - Unit testing for solidity :: 👁
\
t
\
n'
),
'color: white'
)
// set logger verbosity
if
(
commander
.
verbose
)
{
logger
.
setVerbosity
(
commander
.
verbose
)
log
.
info
(
'verbosity level set to '
+
commander
.
verbose
.
blue
)
}
let
web3
=
new
Web3
()
// web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'))
web3
.
setProvider
(
new
Provider
())
// web3.setProvider(new web3.providers.WebsocketProvider('ws://localhost:8546'))
if
(
!
fs
.
existsSync
(
filename
))
{
console
.
error
(
filename
+
' not found'
)
process
.
exit
(
1
)
}
if
(
!
fs
.
existsSync
(
filename
))
{
console
.
error
(
filename
+
' not found'
)
process
.
exit
(
1
)
}
let
isDirectory
=
fs
.
lstatSync
(
filename
).
isDirectory
()
RemixTests
.
runTestFiles
(
filename
,
isDirectory
,
web3
)
})
let
isDirectory
=
fs
.
lstatSync
(
filename
).
isDirectory
()
runTestFiles
(
filename
,
isDirectory
,
web3
)
})
if
(
!
process
.
argv
.
slice
(
2
).
length
)
{
log
.
error
(
'Please specify a filename'
)
process
.
exit
()
log
.
error
(
'Please specify a filename'
)
process
.
exit
()
}
commander
.
parse
(
process
.
argv
)
remix-tests/src/runTestFiles.ts
View file @
b690e2b8
import
async
=
require
(
'async'
)
import
path
=
require
(
'path'
)
import
fs
=
require
(
'./fs'
)
import
fs
from
'./fileSystem'
import
runTest
from
'./testRunner'
require
(
'colors'
)
import
Compiler
=
require
(
'./compiler'
)
import
Deployer
=
require
(
'./deployer'
)
function
runTestFiles
(
filepath
,
isDirectory
,
web3
,
opts
)
{
function
runTestFiles
(
filepath
,
isDirectory
,
web3
,
opts
=
{}
)
{
opts
=
opts
||
{}
const
{
Signale
}
=
require
(
'signale'
)
// signale configuration
...
...
@@ -31,7 +31,7 @@ function runTestFiles(filepath, isDirectory, web3, opts) {
}
}
const
signale
=
new
Signale
(
options
)
let
accounts
=
opts
.
accounts
||
null
let
accounts
=
opts
[
'accounts'
]
||
null
async
.
waterfall
([
function
getAccountList
(
next
)
{
if
(
accounts
)
return
next
(
null
)
...
...
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