<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/testing-a-fastify-app-with-the-nodejs-test-runner-03pep1xhr" -->

---
title: Testing a Fastify app with the NodeJS test runner
description: Learn how to test a Fastify app using the Node.js test runner. Set up a Fastify API server, test the index route, and test a Fastify Postgres plugin. Explore...
canonical: https://daily.dev/posts/testing-a-fastify-app-with-the-nodejs-test-runner-03pep1xhr
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Testing a Fastify app with the NodeJS test runner | daily.dev
og:description: Learn how to test a Fastify app using the Node.js test runner. Set up a Fastify API server, test the index route, and test a Fastify Postgres plugin. Explore...
og:url: https://daily.dev/posts/testing-a-fastify-app-with-the-nodejs-test-runner-03pep1xhr
og:image: https://api.daily.dev/og/posts/03PeP1XhR.png
og:image:alt: Testing a Fastify app with the NodeJS test runner
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Testing a Fastify app with the NodeJS test runner

**[This Dot](https://daily.dev/sources/thisdot)** · 6 min read · 2 upvotes · 0 comments

## Summary

Learn how to test a Fastify app using the Node.js test runner. Set up a Fastify API server, test the index route, and test a Fastify Postgres plugin. Explore the features and methods available with the test runner.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.thisdot.co/blog/testing-a-fastify-app-with-the-nodejs-test-runner>

---

Tags: [#testing](https://daily.dev/tags/testing), [#nodejs](https://daily.dev/tags/nodejs), [#fastify](https://daily.dev/tags/fastify)

[View this post on daily.dev](https://daily.dev/posts/testing-a-fastify-app-with-the-nodejs-test-runner-03pep1xhr)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Testing a Fastify app with the NodeJS test runner","url":"https://daily.dev/posts/testing-a-fastify-app-with-the-nodejs-test-runner-03pep1xhr","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/testing-a-fastify-app-with-the-nodejs-test-runner-03pep1xhr"},"datePublished":"2024-01-26T12:03:49.109Z","dateModified":"2024-05-09T08:58:27.770Z","description":"Learn how to test a Fastify app using the Node.js test runner. Set up a Fastify API server, test the index route, and test a Fastify Postgres plugin. Explore...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c226d9f12290151a3721693f9d162df4?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c226d9f12290151a3721693f9d162df4?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"This Dot","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"This Dot","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/6e22565142ee45b386c8bc12bdb3d117","url":"https://daily.dev/sources/thisdot"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/testing-a-fastify-app-with-the-nodejs-test-runner-03pep1xhr","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"testing,nodejs,fastify","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"This Dot","item":"https://daily.dev/sources/thisdot"},{"@type":"ListItem","position":3,"name":"Testing a Fastify app with the NodeJS test runner"}]}
```

