mirror of
https://github.com/flynx/test.js.git
synced 2025-10-28 10:20:09 +00:00
tweaks and fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
3c39cd69fd
commit
f5cebf4c43
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ig-test",
|
"name": "ig-test",
|
||||||
"version": "1.2.1",
|
"version": "1.2.3",
|
||||||
"description": "experimental test runner....",
|
"description": "experimental test runner....",
|
||||||
"main": "test.js",
|
"main": "test.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
36
test.js
36
test.js
@ -44,6 +44,22 @@ module.VERBOSE = process ?
|
|||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
|
|
||||||
|
// compare two arrays by items...
|
||||||
|
// XXX this is defined in object.js/test.js and here, need to chose one...
|
||||||
|
var arrayCmp = function(a, b){
|
||||||
|
var ka = Object.keys(a)
|
||||||
|
var kb = Object.keys(a)
|
||||||
|
return a === b
|
||||||
|
|| (a.length == b.length
|
||||||
|
&& ka
|
||||||
|
// keep only non matching stuff...
|
||||||
|
.filter(function(k){
|
||||||
|
return a[k] !== b[k]
|
||||||
|
&& a[k] != a[k] })
|
||||||
|
.length == 0) }
|
||||||
|
|
||||||
|
|
||||||
// Assert constructor...
|
// Assert constructor...
|
||||||
//
|
//
|
||||||
// Create an assert callable...
|
// Create an assert callable...
|
||||||
@ -171,6 +187,8 @@ var mergeIter = function(iter){
|
|||||||
.flat() } }
|
.flat() } }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -227,7 +245,7 @@ object.Constructor('Merged', {
|
|||||||
var [name, func] = arguments
|
var [name, func] = arguments
|
||||||
other = {[name]: func}
|
other = {[name]: func}
|
||||||
}
|
}
|
||||||
Object.assign(this, other)
|
object.mixinFlat(this, other)
|
||||||
this.constructor.add(this) },
|
this.constructor.add(this) },
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -257,7 +275,9 @@ object.Constructor('Tests', Merged, {})
|
|||||||
// default blank pass-through...
|
// default blank pass-through...
|
||||||
// NOTE: we need at least one modifier and at least one test for the
|
// NOTE: we need at least one modifier and at least one test for the
|
||||||
// system to run....
|
// system to run....
|
||||||
.add({ '-': function(_, s){ return s }})
|
.add({ '-': function(_, s){
|
||||||
|
console.log('--------------')
|
||||||
|
return s }})
|
||||||
|
|
||||||
|
|
||||||
var Cases =
|
var Cases =
|
||||||
@ -335,8 +355,16 @@ function(spec, chain, stats){
|
|||||||
var assert = Assert('[TEST]', stats, module.VERBOSE)
|
var assert = Assert('[TEST]', stats, module.VERBOSE)
|
||||||
chain_length != 1
|
chain_length != 1
|
||||||
&& object.deepKeys(tests)
|
&& object.deepKeys(tests)
|
||||||
.filter(function(t){
|
.filter(function(t, i, l){
|
||||||
return test == '*' || test == t })
|
return (
|
||||||
|
// skip blank tests if we have other tests unless
|
||||||
|
// explicitly specified...
|
||||||
|
(t == '-'
|
||||||
|
&& test != t
|
||||||
|
&& l.length > 1) ?
|
||||||
|
false
|
||||||
|
: (test == '*'
|
||||||
|
|| test == t) ) })
|
||||||
.forEach(function(t){
|
.forEach(function(t){
|
||||||
// modifiers...
|
// modifiers...
|
||||||
object.deepKeys(modifiers)
|
object.deepKeys(modifiers)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user