Skip to content

Commit

Permalink
Add link to Vitest & Ava docs (#6983)
Browse files Browse the repository at this point in the history
  • Loading branch information
penalosa authored Oct 15, 2024
1 parent 3555cdb commit f866217
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ As a reviewer, it's important to be thoughtful about the proposed changes and co

## PR Tests

Every PR should include tests for the functionality that's being added. Most changes will be to [Wrangler](packages/wrangler/src/__tests__) (using Vitest), [Miniflare](packages/miniflare/test) (using Ava), or [C3](packages/create-cloudflare/src/__tests__) (using Vitest), and should include unit tests within the testing harness of those packages.
Every PR should include tests for the functionality that's being added. Most changes will be to [Wrangler](packages/wrangler/src/__tests__) (using Vitest), [Miniflare](packages/miniflare/test) (using Ava), or [C3](packages/create-cloudflare/src/__tests__) (using Vitest), and should include unit tests within the testing harness of those packages. For documentation on how these testing frameworks work, see:

- Vitest: https://vitest.dev/guide
- Ava: https://github.com/avajs/ava?tab=readme-ov-file#documentation

If your PR includes functionality that's difficult to unit test, you can add a fixture test by creating a new package in the `fixtures/` folder. This allows for adding a test that requires a specific filesystem or worker setup (for instance, `fixtures/no-bundle-import` tests the interaction of Wrangler with a specific set of JS, WASM, text, and binary modules on the filesystem). When adding a fixture test, include a `vitest.config.mts` file within the new package, which will ensure it's run as part of the `workers-sdk` CI. You should merge your own configuration with the default config from the root of the repo.

Expand Down

0 comments on commit f866217

Please sign in to comment.