Run only ONE test with Jest

后端 未结 4 1151
借酒劲吻你
借酒劲吻你 2020-12-28 11:10

Very simple, I want to run just one test with Jest.

I put it.only or describe.only but it still runs a whole lot of tests. I think it runs

4条回答
  •  隐瞒了意图╮
    2020-12-28 11:47

    it's like this:

    jest sometest.test.js -t "some expression to match a describe or a test"
    

    it will test all files with the name sometest.test.js and matching based on -t option, if you only want to test a specific file you can do this:

    jest src/user/.../sometest.test.js
    

提交回复
热议问题