Skip one test in test file Jest

后端 未结 3 682
盖世英雄少女心
盖世英雄少女心 2021-02-04 23:21

I\'m using Jest framework and have a test suite. I want to turn off/skip one of my tests.

Googling documentation doesn\'t give me answers.

Do you know the answ

3条回答
  •  再見小時候
    2021-02-04 23:34

    Skip a test

    If you'd like to skip a test in Jest, you can use test.skip:

    test.skip(name, fn)
    

    Which is also under the following aliases:

    • it.skip(name, fn) or
    • xit(name, fn) or
    • xtest(name, fn)

    Skip a test suite

    Additionally, if you'd like to skip a test suite, you can use describe.skip:

    describe.skip(name, fn)
    

    Which is also under the following alias:

    • xdescribe(name, fn)

提交回复
热议问题