根据Mocha 文档describe/suite,我可以使用或it/test块中的特定模式运行一组测试mocha -g。例如,只有名称中mocha -g 'filtering usernames'带有 的测试。filtering usernames
Test Filters
--fgrep, -f Only run tests containing this string [string]
--grep, -g Only run tests matching this string or regexp [string]
--invert, -i Inverts --grep and --fgrep matches [boolean]
Run Code Online (Sandbox Code Playgroud)
我现在正在使用jest.
如何运行名称与 Jest 中的模式匹配的测试?
浏览 Jest 文档,我自己找到了这个问题的答案 - 保留这个问题,因为答案可能对其他人有用:
来自https://jestjs.io/docs/en/cli
运行与此规范名称匹配的测试(基本上与描述或测试中的名称匹配)。
jest -t name-of-spec
| 归档时间: |
|
| 查看次数: |
1606 次 |
| 最近记录: |