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

Introduction to Fakes

In This Lesson

We'll use AdonisJS Fakes in Japa for isolated testing of service dependencies (like email). Learn to put the mail service in fake mode, call the service method, use built-in assertions, and ensure proper cleanup.

Created by
@tomgobich
Published

Notes Used to Craft this Lesson

AdonisJS has a ton of built-in support for Fakes, making testing various modules super convenient.

Fakes are encapsulated working versions of a real dependency. For example, if we use a mail fake, all the APIs will work the same, but the result will be encapsulated in-memory rather than actually sending an email.

Join the Discussion 0 comments

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

Be the first to comment!