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
0c6c94c0
Commit
0c6c94c0
authored
Feb 01, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
track passing/failing tests
parent
d0ba2f34
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
testRunner.js
src/testRunner.js
+11
-3
No files found.
src/testRunner.js
View file @
0c6c94c0
...
...
@@ -16,7 +16,9 @@ function runTest(testName, testObject, callback) {
runList
.
push
({
name
:
func
.
name
,
type
:
'test'
,
constant
:
func
.
constant
});
}
console
.
log
(
"#"
+
testName
);
let
passingNum
=
0
,
failureNum
=
0
;
console
.
log
((
"#"
+
testName
).
green
);
async
.
eachOfLimit
(
runList
,
1
,
function
(
func
,
index
,
next
)
{
let
method
=
testObject
.
methods
[
func
.
name
].
apply
(
testObject
.
methods
[
func
.
name
],
[]);
if
(
func
.
constant
)
{
...
...
@@ -26,8 +28,10 @@ function runTest(testName, testObject, callback) {
// decide how to handle the output (so works both in console and
// browser)
console
.
log
(
"
\
t✓ "
.
green
.
bold
+
changeCase
.
sentenceCase
(
func
.
name
).
grey
);
passingNum
+=
1
;
}
else
{
console
.
log
(
"
\
t✘ "
.
bold
.
red
+
changeCase
.
sentenceCase
(
func
.
name
).
red
);
failureNum
+=
1
;
}
next
();
});
...
...
@@ -37,8 +41,12 @@ function runTest(testName, testObject, callback) {
});
}
},
function
()
{
console
.
log
(
"1 passing"
.
green
);
console
.
log
(
"1 failing"
.
red
);
if
(
passingNum
>
0
)
{
console
.
log
((
passingNum
+
" passing"
).
green
);
}
if
(
failureNum
>
0
)
{
console
.
log
((
failureNum
+
" failing"
).
red
);
}
});
}
...
...
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