diff --git a/package.json b/package.json index 9d385c8..8a3512c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-test", - "version": "1.2.3", + "version": "1.3.0", "description": "experimental test runner....", "main": "test.js", "bin": { @@ -27,6 +27,6 @@ "colors": "^1.4.0", "glob": "^7.1.6", "ig-argv": "^2.13.0", - "ig-object": "^5.2.2" + "ig-object": "^5.2.6" } } diff --git a/test.js b/test.js index ec8f5fa..610a6d1 100644 --- a/test.js +++ b/test.js @@ -27,7 +27,9 @@ var argv = require('ig-argv') // | // | [ , .. ] // +// XXX need to skip ./node_modules... module.DEFAULT_TEST_FILES = '**/?(*-)test.js' +module.IGNORE_TEST_FILES = ['node_modules/**'] // NOTE: to test in verbose mode do: @@ -519,7 +521,10 @@ argv.Parser({ .forEach(function(path){ ;(path.includes('*') ? // search... - glob.sync(path, {}) + glob.sync(path, { + ignore: this.ignore_files + || module.IGNORE_TEST_FILES, + }) : [path]) // load the modules... .forEach(function(path){ @@ -532,6 +537,18 @@ argv.Parser({ require('./' + path.slice(0, -3)) }) }) }}, + ignore_files: undefined, + + '-i': '-ignore', + '-ignore': { + doc: 'path/pattern to ignore in test file search', + arg: 'PATH | ignore_files', + collect: 'list', + default: function(){ + return this.ignore_files + || module.IGNORE_TEST_FILES } }, + + '-verbose': { doc: 'verbose mode', env: 'VERBOSE',