How to run Jest tests sequentially?

前端 未结 5 906
抹茶落季
抹茶落季 2020-12-12 15:42

I\'m running Jest tests via npm test. Jest runs tests in parallel by default. Is there any way to make the tests run sequentially?

I have some tests cal

5条回答
  •  春和景丽
    2020-12-12 16:31

    I'm still getting familiar with Jest, but it appears that describe blocks run synchronously whereas test blocks run asynchronously. I'm running multiple describe blocks within an outer describe that looks something like this:

    describe
        describe
            test1
            test2
    
        describe
            test3
    

    In this case, test3 does not run until test2 is complete because test3 is in a describe block that follows the describe block that contains test2.

提交回复
热议问题