mirror of
https://github.com/flynx/test.js.git
synced 2025-10-28 02:10:08 +00:00
now all test blocks support other stuff than functions...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
090ba740be
commit
b911ee0bae
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ig-test",
|
||||
"version": "1.4.3",
|
||||
"version": "1.4.4",
|
||||
"description": "experimental test runner....",
|
||||
"main": "test.js",
|
||||
"bin": {
|
||||
@ -26,7 +26,7 @@
|
||||
"dependencies": {
|
||||
"colors": "^1.4.0",
|
||||
"glob": "^7.1.6",
|
||||
"ig-argv": "^2.13.0",
|
||||
"ig-argv": "^2.13.2",
|
||||
"ig-object": "^5.2.6"
|
||||
}
|
||||
}
|
||||
|
||||
25
test.js
25
test.js
@ -455,28 +455,28 @@ function(spec, chain, stats){
|
||||
chain_length != 1
|
||||
&& object.deepKeys(tests)
|
||||
.filter(function(t, i, l){
|
||||
return (
|
||||
return typeof(tests[t]) == 'function'
|
||||
// skip blank tests if we have other tests unless
|
||||
// explicitly specified...
|
||||
(t == '-'
|
||||
&& test != t
|
||||
&& l.length > 1) ?
|
||||
false
|
||||
: (test == '*'
|
||||
|| test == t) ) })
|
||||
&& ((t == '-'
|
||||
&& test != t
|
||||
&& l.length > 1) ?
|
||||
false
|
||||
: (test == '*'
|
||||
|| test == t) ) })
|
||||
.forEach(function(t){
|
||||
// modifiers...
|
||||
object.deepKeys(modifiers)
|
||||
.filter(function(m){
|
||||
return mod == '*' || mod == m })
|
||||
return typeof(modifiers[m]) == 'function'
|
||||
&& (mod == '*' || mod == m) })
|
||||
.forEach(function(m){
|
||||
// setups...
|
||||
object.deepKeys(setups)
|
||||
.filter(function(s){
|
||||
return setup == '*' || setup == s })
|
||||
return typeof(setups[s]) == 'function'
|
||||
&& (setup == '*' || setup == s) })
|
||||
.forEach(function(s){
|
||||
if(typeof(setups[s]) != 'function'){
|
||||
return }
|
||||
// run the test...
|
||||
stats.tests += 1
|
||||
var _assert = assert.push(
|
||||
@ -492,7 +492,8 @@ function(spec, chain, stats){
|
||||
chain_length <= 1
|
||||
&& Object.keys(cases)
|
||||
.filter(function(s){
|
||||
return setup == '*' || setup == s })
|
||||
return typeof(cases[s]) == 'function'
|
||||
&& (setup == '*' || setup == s) })
|
||||
.forEach(function(c){
|
||||
stats.tests += 1
|
||||
cases[c]( assert.push(c) ) })
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user