Compare commits

..

No commits in common. "a8e4ba10f56f531351f7a8c818b65fc998dce754" and "5624805518fb08cd824e39ee543bb111a3245437" have entirely different histories.

2 changed files with 28 additions and 38 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "ig-test", "name": "ig-test",
"version": "1.6.2", "version": "1.6.0",
"description": "experimental test runner....", "description": "experimental test runner....",
"main": "test.js", "main": "test.js",
"bin": { "bin": {

22
test.js
View File

@ -614,12 +614,9 @@ async function(spec, chain, stats, mod_chain_length=1){
var chain_length = chain.length var chain_length = chain.length
var setup = chain.shift() || '*' var setup = chain.shift() || '*'
var test = chain.pop() || '*' var test = chain.pop() || '*'
var mod = chain || '*' var mod = chain.pop() || '*'
mod = chain_length == 2 ? mod = chain_length == 2 ?
'as-is' 'as-is'
: mod.length == 1
&& mod[0] == '*' ?
'*'
: mod : mod
// get the tests... // get the tests...
@ -654,12 +651,10 @@ async function(spec, chain, stats, mod_chain_length=1){
false false
: (test == '*' : (test == '*'
|| test == t) ) }) || test == t) ) })
if(mod_chain_length <= 0){
var mod_queue = [] var mod_queue = []
if(mod_chain_length > 0){
if(mod instanceof Array){
mod_queue = [mod]
} else { } else {
mod_queue = object.deepKeys(modifiers) var mod_queue = object.deepKeys(modifiers)
.filter(function(m){ .filter(function(m){
return typeof(modifiers[m]) == 'function' return typeof(modifiers[m]) == 'function'
&& (mod == '*' || mod == m) }) && (mod == '*' || mod == m) })
@ -674,21 +669,16 @@ async function(spec, chain, stats, mod_chain_length=1){
return mod_queue return mod_queue
.map(function(mm){ .map(function(mm){
return [...m, ...mm] }) }) return [...m, ...mm] }) })
.flat()] } } } .flat()] } }
var setup_queue = object.deepKeys(setups) var setup_queue = object.deepKeys(setups)
.filter(function(s){ .filter(function(s){
return typeof(setups[s]) == 'function' return typeof(setups[s]) == 'function'
&& (setup == '*' || setup == s) }) && (setup == '*' || setup == s) })
// XXX this breaks if mod_queue is empty...
var queue = var queue =
chain_length != 1 ? chain_length != 1 ?
test_queue test_queue
.map(function(t){ .map(function(t){
return mod_queue.length == 0 ? return mod_queue
setup_queue
.map(function(s){
return [[s, [], t]] })
: mod_queue
.map(function(m){ .map(function(m){
return setup_queue return setup_queue
.map(function(s){ .map(function(s){
@ -1082,4 +1072,4 @@ typeof(__filename) != 'undefined'
/********************************************************************** /**********************************************************************
* vim:set ts=4 sw=4 nowrap : */ return module }) * vim:set ts=4 sw=4 : */ return module })