bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2025-12-26 16:24:20 +03:00
parent 5624805518
commit 058db76618
2 changed files with 27 additions and 22 deletions

View File

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

47
test.js
View File

@ -614,9 +614,12 @@ 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.pop() || '*' var mod = chain || '*'
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...
@ -651,25 +654,27 @@ 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){
} else { if(mod instanceof Array){
var mod_queue = object.deepKeys(modifiers) mod_queue = [mod]
.filter(function(m){ } else {
return typeof(modifiers[m]) == 'function' mod_queue = object.deepKeys(modifiers)
&& (mod == '*' || mod == m) }) .filter(function(m){
.map(function(m){ return typeof(modifiers[m]) == 'function'
return [m] }) && (mod == '*' || mod == m) })
// modifier chains... .map(function(m){
for(var i=1; i < mod_chain_length; i++){ return [m] })
mod_queue = [ // modifier chains...
...mod_queue, for(var i=1; i < mod_chain_length; i++){
...mod_queue mod_queue = [
.map(function(m){ ...mod_queue,
return mod_queue ...mod_queue
.map(function(mm){ .map(function(m){
return [...m, ...mm] }) }) return mod_queue
.flat()] } } .map(function(mm){
return [...m, ...mm] }) })
.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'