(upbeat music)
- [Instructor] Here's the solution to the challenge
about organizing your tests.
If you haven't completed it yet, please take a moment
to practice your skills.
We'll start with unit tests
which test the smallest piece of code.
Unit tests are contained within the project itself.
One common location for unit tests is the directory
with the file being tested.
So, file.test.js is the closest match.
Integration tests combine multiple units
and don't involve outside surfaces
so within the project is the most logical location.
Often, integration tests are against a particular API routes
that may call multiple units in order to do their work.
So, a route file within a tests subdirectory
would be a good location.
What about functional tests?
These can sometimes involve a service like a database
and larger pieces of the application.
So, both within and outside the project are possible.
Functional tests often have a workflow
and a series of steps so organizing them by a name
for the workflow is logical.
Finally, system tests exercise the entire application.
An application can be made up of multiple projects
so outside the project is the most likely location.
An example of a system test is a load test
so this would be the most likely answer.
There's more than one way to organize tests
and these are not absolute answers
but they do give some ways to start organizing.
What's the best way to organize tests within your project?