How does jest execute a single set of test cases

Time:2022-1-25

If there is this documenttests/test.test.ts

describe('test-group', () => {
    it('t1', async() => {
        console.log('t1');
    });
    it('t2', () => {
        console.log('t2');
    });
});

I just want to run T2 inside, so I can do this:

npx jest tests/test.test.ts --testNamePattern="test-group t2"

Cross levels can be separated by spaces.

Related documents:https://jestjs.io/zh-Hans/doc…

Recommended Today

Building the basic static page of Vue chat room

design sketch HTML: <template>     <view>         <view>             <scroll-view scroll-y=”true”>                 <div> <!– Message notification — >                     <div>                         <div>2021-12-28 16:50:00</div> < div > XXX processed this work order < / div >                     </div> <!– Left — >                     <!– <div></div> –> <!– Right — >                     <!– <div></div> –>               </div>               <div>                 <div>                     <image src=”../../static/logo.png”>                     <div>                         <div>2021-12-28 16:50:00</div> < […]