【发布时间】:2021-12-07 11:16:25
【问题描述】:
考虑以下测试用例:
describe("parent1", () => {
it("mytest", () => {
// ...
});
});
describe("parent2", () => {
it("mytest", () => {
// ...
});
});
describe("parent1", () => {
it("myothertest", () => {
// ...
});
});
describe("parent2", () => {
it("myothertest", () => {
// ...
});
});
我基本上希望能够通过命令行在parent1 下运行mytest。
尝试
如果我尝试以下操作:
mocha --grep 'mytest'
它将最终运行:
parent1/mytestparent2/mytest
如果我尝试:
mocha --grep 'parent1'
它将最终运行:
parent1/mytestparent1/myothertest
如何做到这一点?
【问题讨论】:
-
mocha --grep 'parent1/mytest'呢? -
@evolutionxbox 会起作用吗?我可以试试
-
似乎不起作用,它找不到任何要运行的测试
标签: javascript mocha.js