mirror of
https://github.com/flynx/test.js.git
synced 2025-10-28 02:10:08 +00:00
bugfix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
214fef4514
commit
c68f30cf99
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ig-test",
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.3",
|
||||
"description": "experimental test runner....",
|
||||
"main": "test.js",
|
||||
"bin": {
|
||||
|
||||
20
test.js
20
test.js
@ -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,13 +612,18 @@ 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 || {
|
||||
setups: Setups,
|
||||
modifiers: Modifiers,
|
||||
tests: Tests,
|
||||
cases: Cases,
|
||||
}
|
||||
var tests = tests
|
||||
|| {
|
||||
setups: Setups,
|
||||
modifiers: Modifiers,
|
||||
tests: Tests,
|
||||
cases: Cases,
|
||||
}
|
||||
var p = Object.assign(
|
||||
Object.create(parser),
|
||||
tests,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user