如何避免node_modules测试,例如json-schema-traverse?

问题描述 投票:-1回答:1

我有5个自己的测试,2个通过,4个失败(故意,因为我让它们通过了。

但是我也有其他12个json-schema-traverse测试,但我不确定它们来自哪里。我找不到包含它们的文件。

enter image description here

json mocha
1个回答
-1
投票

[我的npm package.json中的测试选择器

"test": "mocha **/*.spec.*"

node_modules/中增加其他测试

我可以通过使用--exclude来避免在节点模块中进行这些测试,>

mocha **/*.spec.js --exclude node_modules/**/*.spec.js

避免使用排除的另一种方法可以更改:

**/*.spec.*

例如,to

./*.spec.js ./test/*spec.js
© www.soinside.com 2019 - 2024. All rights reserved.