Directory Organization

Let’s have a look at how to organize testing in a project.

We'll cover the following

To start, we need a way to organize our tests. There are two main approaches: putting the tests together in the same directory with the implementation files or putting them in a separate directory. We will use the latter approach, but the choice is largely a matter of convenience and personal preference, with the only side effects being different test runner configurations.

We will create a separate test file for each implementation file in our project. In the case of app/actions/recipes.js, our test file will be tests/actions/recipes.test.js.

Get hands-on with 1400+ tech skills courses.