mirror of
https://github.com/flynx/object.js.git
synced 2025-10-29 02:20:08 +00:00
minor rework of test.js commandline opts + minor fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
fd250a8025
commit
0f1b7582e1
35
test.js
35
test.js
@ -389,6 +389,9 @@ function(chain, stats){
|
||||
var setup = chain.shift() || '*'
|
||||
var test = chain.pop() || '*'
|
||||
var mod = chain.pop() || '*'
|
||||
mod = chain_length == 2 ?
|
||||
'as-is'
|
||||
: mod
|
||||
|
||||
// stats...
|
||||
stats = stats || {}
|
||||
@ -466,6 +469,27 @@ if(typeof(__filename) != 'undefined'
|
||||
if(arg == 'v' || arg == 'verbose'){
|
||||
module.VERBOSE=true
|
||||
|
||||
// list...
|
||||
} else if(arg == 'l' || arg == 'list'){
|
||||
console.log(object.normalizeTextIndent(
|
||||
`Setups:
|
||||
${ Object.keys(setups)
|
||||
.join('\n\t\t\t\t\t\t') }
|
||||
|
||||
Modifiers:
|
||||
${ Object.keys(modifiers)
|
||||
.join('\n\t\t\t\t\t\t') }
|
||||
|
||||
Tests:
|
||||
${ Object.keys(tests)
|
||||
.join('\n\t\t\t\t\t\t') }
|
||||
|
||||
Standalone test cases:
|
||||
${ Object.keys(cases)
|
||||
.join('\n\t\t\t\t\t\t') }
|
||||
`))
|
||||
process.exit()
|
||||
|
||||
// help...
|
||||
// XXX format the lists better... word-wrap??
|
||||
} else if(arg == 'h' || arg == 'help'){
|
||||
@ -480,19 +504,10 @@ if(typeof(__filename) != 'undefined'
|
||||
Each item can either be a specific item name or '*' to indicate any/all
|
||||
items.
|
||||
|
||||
Setups:
|
||||
${ Object.keys(setups).join(', ') }
|
||||
|
||||
Modifiers:
|
||||
${ Object.keys(modifiers).join(', ') }
|
||||
|
||||
Tests:
|
||||
${ Object.keys(tests).join(', ') }
|
||||
|
||||
Options:
|
||||
-h | --help print this message and exit
|
||||
-v | --verbose verbose mode
|
||||
|
||||
-l | --list list available tests
|
||||
`))
|
||||
process.exit() }
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user