> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://akamai.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://akamai.ferndocs.com/_mcp/server.

# Unit testing for EdgeWorkers

Unit testing can help you find bugs. Finding and fixing bugs early in the development cycle will improve the quality of your code and make the testing phase easier. It can also reduce the risk of regression. 

A unit test runs code over each segment of your program, checking the input and output. These tests allow developers to check individual areas of a program to see where and why errors are occurring.

Akamai provides unit testing frameworks for EdgeWorkers to help you with this process. 

The [repository](https://github.com/akamai/edgeworkers-unittest) provides a set of mocks for the testing frameworks below:

- [Jest](https://github.com/akamai/edgeworkers-unittest/tree/main/jest)
- [Mocha](https://github.com/akamai/edgeworkers-unittest/tree/main/mocha)

For detailed instructions on how to set up a suite of unit tests with Jest and Mocha, refer to the [Getting started guide for EdgeWorkers Unit Testing framework](https://github.com/akamai/edgeworkers-unittest).