How Mocha knows which file to load first in the test suite

前端 未结 3 1372
抹茶落季
抹茶落季 2021-02-08 13:58

I\'m trying to learn the A Test Driven Approach with MongodB. The folder structure

A user.js to test in the src folder

const mongo         


        
3条回答
  •  清酒与你
    2021-02-08 14:44

    It doesn't

    Tests should not have a specific order. All test suites should be working as standalone agnostic to other suites. Inside the suite you can use "before" and "beforeEach" (or "after", "afterEach") in-order to create setup and teardown steps.

    But if the order of the tests matters, something is broken in the design.

提交回复
热议问题