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 #5.1

Testing Database-Driven Endpoints

In This Lesson

We'll learn how to functionally test a registration endpoint using a test database. We'll learn about global transactions and how we can use them to easily reset our database between tests and confirm database state with Lucid.

Created by
@tomgobich
Published

Now that we have a separate database for our tests, we can send API requests to our app, and our app will work within our siloed test database.

Our registration flow will be perfect for these tests, and we've worked with a portion of it before in our fakes lesson when we verified that one of its methods sent a welcome email.

node ace make:test auth --suite=functional

Join the Discussion 0 comments

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

Be the first to comment!