Ready to get started?

Join Adocasts Plus for $8/mo, or sign into an existing Adocasts Plus account, to get access to all of our lessons.

robot mascot smiling

Pragmatic Testing in AdonisJS with Japa #4.0

Functional vs Unit Testing

In This Lesson

We'll distinguish between Unit and Functional testing. We'll discuss how Unit tests are for isolated code and are lightweight, while Functional tests boot the HTTP server to test the entire application stack from request to response.

Created by
@tomgobich
Published

Notes Used to Craft this Lesson

Until now, we've been focused on unit testing, which is testing individual units of code in isolation. Unit testing is ideal for testing individual service methods, event listeners, and the like. They're lightweight and don't interfere with our AdonisJS HTTP server, while still allowing us to work with the IoC Container to utilize mocks and fakes, as well as other underlying application-level bindings.

Functional tests, on the other hand, will boot our AdonisJS HTTP server as they're meant to test from the outside in, including requests, routes, middleware, controllers, and responses needed to complete individual requests.

Join the Discussion 0 comments

Create a free account to join in on the discussion
robot comment bubble

Be the first to comment!