tweaking...

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

View File

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

12
test.js
View File

@ -612,9 +612,15 @@ function(default_files, tests){
tests = default_files tests = default_files
default_files = undefined } default_files = undefined }
// patch require.cache to make the clients load the global module... // patch require.cache...
var local = path.join(process.cwd(), 'node_modules', 'ig-test', 'test.js') // NOTE: this will make all the client scripts see the global module
require.cache[local] = require.cache[require.main.filename] // instead of local stuff...
if(typeof(__filename) != 'undefined'
&& __filename == (require.main || {}).filename){
// XXX is guessing this the correct way to do this???
// ...should we use glog.sync(process.cwd()+'/**/ig-test/test.js') instead???
var local = path.join(process.cwd(), 'node_modules', 'ig-test', 'test.js')
require.cache[local] = require.cache[require.main.filename] }
var stats = {} var stats = {}
var tests = tests var tests = tests