Jest stop test suite after first fail

后端 未结 3 1419
清酒与你
清酒与你 2020-12-20 11:12

I am using Jest for testing.

What I want, is to stop executing the current test suite when a test in that test suite fails.

The option --bail is

3条回答
  •  Happy的楠姐
    2020-12-20 11:33

    I guess that other tests in that suite depend on all previous tests be successful. This is a bad practice in unit testing. Try using beforeEach and afterEach to decouple individual test cases within a suite, so that they don't rely on each other.

提交回复
热议问题