If there is this file tests/test.test.ts
:
describe('test-group', () => {
it('t1', async() => {
console.log('t1');
});
it('t2', () => {
console.log('t2');
});
});
I just want to run the t2 inside, you can do this:
npx jest tests/test.test.ts --testNamePattern="test-group t2"
Separate the levels with spaces.
Related documentation: https://jestjs.io/zh-Hans/docs/cli#--testnamepatternregex
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。