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
7dfb3526
Unverified
Commit
7dfb3526
authored
Aug 22, 2018
by
yann300
Committed by
GitHub
Aug 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20 from ethereum/after_hooks
add afterEach and afterAll hooks
parents
0a255757
3672f1a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
testRunner.js
src/testRunner.js
+8
-1
No files found.
src/testRunner.js
View file @
7dfb3526
...
@@ -7,7 +7,7 @@ function getAvailableFunctions (jsonInterface) {
...
@@ -7,7 +7,7 @@ function getAvailableFunctions (jsonInterface) {
}
}
function
getTestFunctions
(
jsonInterface
)
{
function
getTestFunctions
(
jsonInterface
)
{
let
specialFunctions
=
[
'beforeAll'
,
'beforeEach'
]
let
specialFunctions
=
[
'beforeAll'
,
'beforeEach'
,
'afterAll'
,
'afterEach'
]
return
jsonInterface
.
filter
((
x
)
=>
specialFunctions
.
indexOf
(
x
.
name
)
<
0
&&
x
.
type
===
'function'
)
return
jsonInterface
.
filter
((
x
)
=>
specialFunctions
.
indexOf
(
x
.
name
)
<
0
&&
x
.
type
===
'function'
)
}
}
...
@@ -25,6 +25,13 @@ function createRunList (jsonInterface) {
...
@@ -25,6 +25,13 @@ function createRunList (jsonInterface) {
runList
.
push
({
name
:
'beforeEach'
,
type
:
'internal'
,
constant
:
false
})
runList
.
push
({
name
:
'beforeEach'
,
type
:
'internal'
,
constant
:
false
})
}
}
runList
.
push
({
name
:
func
.
name
,
type
:
'test'
,
constant
:
func
.
constant
})
runList
.
push
({
name
:
func
.
name
,
type
:
'test'
,
constant
:
func
.
constant
})
if
(
availableFunctions
.
indexOf
(
'afterEach'
)
>=
0
)
{
runList
.
push
({
name
:
'afterEach'
,
type
:
'internal'
,
constant
:
false
})
}
}
if
(
availableFunctions
.
indexOf
(
'afterAll'
)
>=
0
)
{
runList
.
push
({
name
:
'afterAll'
,
type
:
'internal'
,
constant
:
false
})
}
}
return
runList
return
runList
...
...
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