mirror of
https://github.com/flynx/test.js.git
synced 2025-10-28 10:20:09 +00:00
cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
c41864e07f
commit
214fef4514
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ig-test",
|
||||
"version": "1.3.1",
|
||||
"version": "1.3.2",
|
||||
"description": "experimental test runner....",
|
||||
"main": "test.js",
|
||||
"bin": {
|
||||
|
||||
24
test.js
24
test.js
@ -27,11 +27,21 @@ var argv = require('ig-argv')
|
||||
// | <path>
|
||||
// | [ <path>, .. ]
|
||||
//
|
||||
// XXX need to skip ./node_modules...
|
||||
module.DEFAULT_TEST_FILES = '**/?(*-)test.js'
|
||||
|
||||
|
||||
//
|
||||
// IGNORE_TEST_FILES =
|
||||
// undefined
|
||||
// | [ <path>, .. ]
|
||||
//
|
||||
module.IGNORE_TEST_FILES = ['node_modules/**']
|
||||
|
||||
|
||||
//
|
||||
// VERBOSE = <bool>
|
||||
//
|
||||
//
|
||||
// NOTE: to test in verbose mode do:
|
||||
// $ VERBOSE=1 npm test
|
||||
// or
|
||||
@ -277,9 +287,7 @@ object.Constructor('Tests', Merged, {})
|
||||
// default blank pass-through...
|
||||
// NOTE: we need at least one modifier and at least one test for the
|
||||
// system to run....
|
||||
.add({ '-': function(_, s){
|
||||
console.log('--------------')
|
||||
return s }})
|
||||
.add({ '-': function(_, s){ return s }})
|
||||
|
||||
|
||||
var Cases =
|
||||
@ -525,8 +533,8 @@ argv.Parser({
|
||||
// search...
|
||||
glob.sync(path, {
|
||||
ignore: this.ignore_files
|
||||
|| module.IGNORE_TEST_FILES,
|
||||
})
|
||||
|| module.IGNORE_TEST_FILES
|
||||
|| [], })
|
||||
: [path])
|
||||
// load the modules...
|
||||
.forEach(function(path){
|
||||
@ -534,6 +542,7 @@ argv.Parser({
|
||||
if(!/.*\.js$/.test(path)){
|
||||
throw argv.ParserError(
|
||||
`${key}: only support .js modules, got: "${path}"`) }
|
||||
console.log('found module:', path)
|
||||
// XXX should we handle the load error here???
|
||||
that.test_modules[path] =
|
||||
require(process.cwd() +'/'+ path.slice(0, -3)) }) }) }},
|
||||
@ -549,7 +558,8 @@ argv.Parser({
|
||||
collect: 'list',
|
||||
default: function(){
|
||||
return this.ignore_files
|
||||
|| module.IGNORE_TEST_FILES } },
|
||||
|| module.IGNORE_TEST_FILES
|
||||
|| [] } },
|
||||
|
||||
|
||||
'-verbose': {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user