cloudflare · Cloudflare Workers Docs
Workers test
How to use the MockTracker API within Cloudflare Workers to track and manage mock objects during testing, including the requirement to enable the nodejs_compat compatibility flag.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Workers test
How to use the MockTracker API within Cloudflare Workers to track and manage mock objects during testing, including the requirement to enable the nodejs_compat compatibility flag.
When To Use
Use when you need to implement object mocking and tracking within a Cloudflare Workers test environment using Node.js compatibility APIs.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-runtime-apis-nodejs-test-workflow-guide.md | A guide explaining how to enable and test built-in Node.js APIs and polyfills in Cloudflare Workers using the nodejs_compat compatibility flag. | Questions about a guide explaining how to enable and test built-in Node.js APIs and polyfills in Cloudflare Workers using the nodejsc... |
examples/workers-runtime-apis-nodejs-test-cloudflare-workers-nodejs-test-mock.text | A text example demonstrating how to use the node:test mock function within a Cloudflare Workers environment. | Exact payloads, commands, or snippets shown in A text example demonstrating how to use the node:test mock function within a Cloudflare Workers environment. |
What This Skill Covers
- To enable built-in Node.js APIs and polyfills, add the nodejs\compat compatibility flag to your Wrangler configuration file. This also enables nodejs\compat...
- Main sections:
MockTracker.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.cloudflare.com/workers/runtime-apis/nodejs/test/index.md
