Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Webpack 使用网页包别名时如何设置mocha测试观察者脚本?_Webpack_Tdd_Mocha.js_Redux_Alias - Fatal编程技术网

Webpack 使用网页包别名时如何设置mocha测试观察者脚本?

Webpack 使用网页包别名时如何设置mocha测试观察者脚本?,webpack,tdd,mocha.js,redux,alias,Webpack,Tdd,Mocha.js,Redux,Alias,我很难让我的mocha测试监视程序监视那些路径依赖于Web包别名的文件。测试正常运行,但不监视任何别名文件或从别名文件导入的文件 我引用这个答案是为了让我的测试脚本正常工作,但它不适用于我的监视脚本 以下是我的测试脚本: "test": "NODE_PATH=$NODE_PATH:../ mocha --compilers js:babel-core/register --require ./tests/test-helpers.js 'tests/**/*.@(js|jsx)'", "test

我很难让我的mocha测试监视程序监视那些路径依赖于Web包别名的文件。测试正常运行,但不监视任何别名文件或从别名文件导入的文件

我引用这个答案是为了让我的测试脚本正常工作,但它不适用于我的监视脚本

以下是我的测试脚本:

"test": "NODE_PATH=$NODE_PATH:../ mocha --compilers js:babel-core/register --require ./tests/test-helpers.js 'tests/**/*.@(js|jsx)'",
"test:watch": "npm run test -- --watch --watch-extensions -jsx"
我还使用
“NODE\u PATH=./”
运行了
“test”
脚本,该脚本也有同样的问题

注意,对于从非别名文件导入,watcher运行得非常好