How do I run a single test using Jest?

后端 未结 14 1835
轮回少年
轮回少年 2020-12-12 10:22

I have a test \'works with nested children\' within the file fix-order-test.js.

Running the below runs all the tests in the file.

jest fix-order-test         


        
14条回答
  •  天涯浪人
    2020-12-12 10:38

    npm test __tests__/filename.test.ts - to run a single file.

    test.only('check single test', () => { expect(true).toBe(true)}); - to run a single test case

    test.skip('to skip testcase, () => {expect(false).toBe(false_}); - to skip a test case

提交回复
热议问题