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
d76d4f68
Commit
d76d4f68
authored
Jul 25, 2019
by
yann300
Committed by
François
Jul 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API for running test from a plugin
parent
3092f6d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
test-tab.js
src/app/tabs/test-tab.js
+22
-1
No files found.
src/app/tabs/test-tab.js
View file @
d76d4f68
...
...
@@ -10,7 +10,7 @@ const TestTabLogic = require('./testTab/testTab')
const
profile
=
{
name
:
'solidityUnitTesting'
,
displayName
:
'Solidity unit testing'
,
methods
:
[],
methods
:
[
'startTestFromPath'
,
'startTestFromSourceCode'
],
events
:
[],
icon
:
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4wUDEhQZ0zbrmQAAAfNJREFUWMPF17lrFVEUx/EPaIKovfAScSndjUtULFQSYhHF0r/Dwsa/RywUiTaWgvaChWsiKkSMZte4o7G5A49x7r0zLy/PA6eZOef3PXebuYfu2xCmcQ9b9NgOYw6rwR9ia6/gR7HQBi/8PjavN/w4FivghV9bT/gwlhLwHzjTVPQ8rqAvE3ciA/+O8abwy/gVBG4lijiJ5czIL64FXvhNbCzFnaoBv9AUPo7fEcEb2BDiTuNTAv4NYxX6u/EIM7GZuZoQXcX1sJk+J2K+YrRCexfetsX9xKVyUB9uZ4r4k3j3BSMR+JvIMv2zQfsxkSkiBj9XAd8ZgRf+vmop+nGnAXwlcs534HUm93FsQ9YtIjby7XiVyZ3BntSpyBWxgrMR+FQG/gF76xzNftxtMO1rgo+G5AdBqLBN4d9eCCyHD1En8Oi0j4UPSBE4hcFSERN4Fz7BZRvEZKcjHynBC5/EQI1lGqgJ3xcTmE4kvswUMRBiUvCPKTg8zQi8QKsirxXe5eD7c1N4ALMZoeelIlrhWSpnNmjXsoM1iihmYhueZGIXcKTp7/hQ6UZb5c+Cp2LmglZHVqeIlC+G2/GarNMiFnGsWzfdpkV0Fd7e5czXgC+FvmDdWq35/wVvbzbnI/DhXvV9Q6W+r6fw9hZsKnjX4H8B0Aamri7CrBsAAAAASUVORK5CYII='
,
description
:
'Fast tool to generate unit tests for your contracts'
,
...
...
@@ -139,6 +139,27 @@ module.exports = class TestTab extends ViewPlugin {
})
}
async
startTestFromPath
(
path
)
{
const
fileContent
=
await
this
.
fileManager
.
getFile
(
path
)
return
this
.
startTestFromSourceCode
(
fileContent
,
path
)
}
/*
Test are not associated with the UI
*/
startTestFromSourceCode
(
content
,
path
=
'unit-test.sol'
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
runningTest
=
{}
runningTest
[
path
]
=
{
content
}
remixTests
.
runTestSources
(
runningTest
,
()
=>
{},
()
=>
{},
(
error
,
result
)
=>
{
if
(
error
)
return
reject
(
error
)
resolve
(
result
)
},
(
url
,
cb
)
=>
{
return
this
.
compileTab
.
compileTabLogic
.
importFileCb
(
url
,
cb
)
})
})
}
runTest
(
testFilePath
,
callback
)
{
this
.
loading
.
hidden
=
false
this
.
fileManager
.
getFile
(
testFilePath
).
then
((
content
)
=>
{
...
...
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