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
2ee6ec8a
Commit
2ee6ec8a
authored
Feb 01, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support beforeEach; if condition for adding special functions
parent
e525eaad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
testRunner.js
src/testRunner.js
+4
-1
No files found.
src/testRunner.js
View file @
2ee6ec8a
...
@@ -8,11 +8,14 @@ function runTest(testName, testObject, testCallback, resultsCallback) {
...
@@ -8,11 +8,14 @@ function runTest(testName, testObject, testCallback, resultsCallback) {
let
availableFunctions
=
testObject
.
_jsonInterface
.
filter
((
x
)
=>
x
.
type
===
'function'
).
map
((
x
)
=>
x
.
name
);
let
availableFunctions
=
testObject
.
_jsonInterface
.
filter
((
x
)
=>
x
.
type
===
'function'
).
map
((
x
)
=>
x
.
name
);
let
testFunctions
=
testObject
.
_jsonInterface
.
filter
((
x
)
=>
specialFunctions
.
indexOf
(
x
.
name
)
<
0
&&
x
.
type
===
'function'
);
let
testFunctions
=
testObject
.
_jsonInterface
.
filter
((
x
)
=>
specialFunctions
.
indexOf
(
x
.
name
)
<
0
&&
x
.
type
===
'function'
);
if
(
availableFunctions
.
indexOf
(
"beforeAll"
))
{
if
(
availableFunctions
.
indexOf
(
"beforeAll"
)
>=
0
)
{
runList
.
push
({
name
:
'beforeAll'
,
type
:
'internal'
,
constant
:
false
});
runList
.
push
({
name
:
'beforeAll'
,
type
:
'internal'
,
constant
:
false
});
}
}
for
(
let
func
of
testFunctions
)
{
for
(
let
func
of
testFunctions
)
{
if
(
availableFunctions
.
indexOf
(
"beforeEach"
)
>=
0
)
{
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
});
}
}
...
...
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