bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-08-16 05:17:20 +03:00
parent 214fef4514
commit c68f30cf99
2 changed files with 14 additions and 8 deletions

View File

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

10
test.js
View File

@ -11,6 +11,7 @@
(function(require){ var module={} // make module AMD/node compatible...
/*********************************************************************/
var path = require('path')
var colors = require('colors')
var glob = require('glob')
@ -542,7 +543,7 @@ argv.Parser({
if(!/.*\.js$/.test(path)){
throw argv.ParserError(
`${key}: only support .js modules, got: "${path}"`) }
console.log('found module:', path)
console.log('Loading module:', path)
// XXX should we handle the load error here???
that.test_modules[path] =
require(process.cwd() +'/'+ path.slice(0, -3)) }) }) }},
@ -611,8 +612,13 @@ function(default_files, tests){
tests = default_files
default_files = undefined }
// patch require.cache to make the clients load the global module...
var local = path.join(process.cwd(), 'node_modules', 'ig-test', 'test.js')
require.cache[local] = require.cache[require.main.filename]
var stats = {}
var tests = tests || {
var tests = tests
|| {
setups: Setups,
modifiers: Modifiers,
tests: Tests,