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
8d6abf3c
Commit
8d6abf3c
authored
Feb 19, 2019
by
Iuri Matias
Committed by
yann300
Mar 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move get tests to test tab logic
parent
fc40e5f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
test-tab.js
src/app/tabs/test-tab.js
+1
-16
testTab.js
src/app/tabs/testTab/testTab.js
+15
-0
No files found.
src/app/tabs/test-tab.js
View file @
8d6abf3c
...
...
@@ -41,7 +41,7 @@ module.exports = class TestTab extends ApiFactory {
})
this
.
fileManager
.
event
.
register
(
'currentFileChanged'
,
(
file
,
provider
)
=>
{
this
.
getTests
((
error
,
tests
)
=>
{
this
.
testTabLogic
.
getTests
((
error
,
tests
)
=>
{
if
(
error
)
return
tooltip
(
error
)
this
.
data
.
allTests
=
tests
this
.
data
.
selectedTests
=
[...
this
.
data
.
allTests
]
...
...
@@ -59,21 +59,6 @@ module.exports = class TestTab extends ApiFactory {
})
}
getTests
(
cb
)
{
var
path
=
this
.
fileManager
.
currentPath
()
if
(
!
path
)
return
cb
(
null
,
[])
var
provider
=
this
.
fileManager
.
fileProviderOf
(
path
)
if
(
!
provider
)
return
cb
(
null
,
[])
var
tests
=
[]
this
.
fileManager
.
filesFromPath
(
path
,
(
error
,
files
)
=>
{
if
(
error
)
return
cb
(
error
)
for
(
var
file
in
files
)
{
if
(
/.
(
_test.sol
)
$/
.
exec
(
file
))
tests
.
push
(
provider
.
type
+
'/'
+
file
)
}
cb
(
null
,
tests
)
})
}
listTests
()
{
return
this
.
data
.
allTests
.
map
(
test
=>
yo
`<label class="singleTestLabel"><input class="singleTest" onchange =
${(
e
)
=>
this
.
toggleCheckbox
(
e
.
target
.
checked
,
test
)}
type="checkbox" checked="true">
${
test
}
</label>`
)
}
...
...
src/app/tabs/testTab/testTab.js
View file @
8d6abf3c
...
...
@@ -18,6 +18,21 @@ class TestTabLogic {
})
}
getTests
(
cb
)
{
var
path
=
this
.
fileManager
.
currentPath
()
if
(
!
path
)
return
cb
(
null
,
[])
var
provider
=
this
.
fileManager
.
fileProviderOf
(
path
)
if
(
!
provider
)
return
cb
(
null
,
[])
var
tests
=
[]
this
.
fileManager
.
filesFromPath
(
path
,
(
error
,
files
)
=>
{
if
(
error
)
return
cb
(
error
)
for
(
var
file
in
files
)
{
if
(
/.
(
_test.sol
)
$/
.
exec
(
file
))
tests
.
push
(
provider
.
type
+
'/'
+
file
)
}
cb
(
null
,
tests
)
})
}
generateTestContractSample
()
{
return
`pragma solidity >=0.4.0 <0.6.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.
...
...
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