admin管理员组文章数量:1401963
Here is my "scripts" section of package.json:
"scripts": {
"pretest": "eslint \"**/*.js\" --ignore-pattern node_modules/",
"test": "mocha"
}
and here is my .mocharc.js
:
'use strict';
module.exports = {
diff: true,
extension: ['js'],
package: './package.json',
reporter: 'landing',
slow: 75,
timeout: 2000,
ui: 'bdd',
watchFiles: ['src/tests/*.js', 'src/tests/**/*.js'],
};
When running npm test
I get pretest running correctly, but mocha seems to ignore config file. Haven't seen the issue anywhere yet.
Here is my "scripts" section of package.json:
"scripts": {
"pretest": "eslint \"**/*.js\" --ignore-pattern node_modules/",
"test": "mocha"
}
and here is my .mocharc.js
:
'use strict';
module.exports = {
diff: true,
extension: ['js'],
package: './package.json',
reporter: 'landing',
slow: 75,
timeout: 2000,
ui: 'bdd',
watchFiles: ['src/tests/*.js', 'src/tests/**/*.js'],
};
When running npm test
I get pretest running correctly, but mocha seems to ignore config file. Haven't seen the issue anywhere yet.
2 Answers
Reset to default 4Try running Mocha with --config
options.
Example: mocha --config .mocharc.js
And your watchFiles
option is wrong. It should be watch-files
.
See this mocha example: https://github./mochajs/mocha/blob/master/example/config/.mocharc.js
Try adding the following to your .mocharc.js
recursive: true
本文标签: javascriptMocha ignores existing mocharcjs config fileStack Overflow
版权声明:本文标题:javascript - Mocha ignores existing .mocharc.js config file - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744261466a2597736.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论