<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/improved-cloudflare-workers-testing-via-vitest-and-workerd-7gdmtswsi" -->

---
title: Improved Cloudflare Workers testing via Vitest and workerd
description: Cloudflare has announced a new Workers Vitest integration that allows developers to write unit and integration tests for Cloudflare Workers. This integration...
canonical: https://daily.dev/posts/improved-cloudflare-workers-testing-via-vitest-and-workerd-7gdmtswsi
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Improved Cloudflare Workers testing via Vitest and workerd | daily.dev
og:description: Cloudflare has announced a new Workers Vitest integration that allows developers to write unit and integration tests for Cloudflare Workers. This integration...
og:url: https://daily.dev/posts/improved-cloudflare-workers-testing-via-vitest-and-workerd-7gdmtswsi
og:image: https://api.daily.dev/og/posts/7gDMtSWSI.png
og:image:alt: Improved Cloudflare Workers testing via Vitest and workerd
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.

# Improved Cloudflare Workers testing via Vitest and workerd

**[Cloudflare](https://daily.dev/sources/cloudflare)** · 13 min read · 2 upvotes · 0 comments

## Summary

Cloudflare has announced a new Workers Vitest integration that allows developers to write unit and integration tests for Cloudflare Workers. This integration provides the ability to run tests within the same runtime as Cloudflare Workers in production, allowing for greater confidence in the behavior of Workers when deployed. The integration also includes features like hot-module-reloading, watch mode, and per-test isolated storage. Developers can get started with testing Workers via Vitest by using the create-cloudflare tool or by manually installing and setting up the Workers Vitest integration.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.cloudflare.com/workers-vitest-integration>

---

Tags: [#cloudflare](https://daily.dev/tags/cloudflare), [#testing](https://daily.dev/tags/testing), [#vitest](https://daily.dev/tags/vitest)

[View this post on daily.dev](https://daily.dev/posts/improved-cloudflare-workers-testing-via-vitest-and-workerd-7gdmtswsi)

```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":"Improved Cloudflare Workers testing via Vitest and workerd","url":"https://daily.dev/posts/improved-cloudflare-workers-testing-via-vitest-and-workerd-7gdmtswsi","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/improved-cloudflare-workers-testing-via-vitest-and-workerd-7gdmtswsi"},"datePublished":"2024-03-15T14:13:13.223Z","dateModified":"2024-07-02T02:15:34.574Z","description":"Cloudflare has announced a new Workers Vitest integration that allows developers to write unit and integration tests for Cloudflare Workers. This integration...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ab8883e7eb067a85a6c8ec8122aed860?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ab8883e7eb067a85a6c8ec8122aed860?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"Cloudflare","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":"Cloudflare","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/38522e1d11354cd6b7af66f9d4316735","url":"https://daily.dev/sources/cloudflare"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/improved-cloudflare-workers-testing-via-vitest-and-workerd-7gdmtswsi","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"cloudflare,testing,vitest","timeRequired":"PT13M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Cloudflare","item":"https://daily.dev/sources/cloudflare"},{"@type":"ListItem","position":3,"name":"Improved Cloudflare Workers testing via Vitest and workerd"}]}
```

