From the course: Node.js: Testing and Code Quality
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Solution: Organize your tests
From the course: Node.js: Testing and Code Quality
Solution: Organize your tests
(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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
What is code quality?6m 57s
-
(Locked)
Coding conventions and standards6m 38s
-
(Locked)
Creating and enforcing coding standards7m 27s
-
(Locked)
Unit, integration, and functional testing10m 30s
-
(Locked)
Testing frameworks5m 53s
-
(Locked)
TDD and BDD test specifications5m 12s
-
(Locked)
Assertions for correctness4m 32s
-
(Locked)
Challenge: Organize your tests58s
-
(Locked)
Solution: Organize your tests1m 46s
-
-
-
-
-
-