preact · Preact Docs
Preact Unit Testing with Enzyme
Instructions for setting up and configuring the Enzyme testing library with the Preact adapter, including installation, configuration, and implementation examples for component testing.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Preact Unit Testing with Enzyme
Instructions for setting up and configuring the Enzyme testing library with the Preact adapter, including installation, configuration, and implementation examples for component testing.
When To Use
Use when you need to set up a unit testing environment for Preact components using Enzyme and the Preact adapter.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/preact-unit-testing-with-enzyme-workflow-guide.md | A comprehensive guide covering essentials, debugging, and advanced techniques for unit testing Preact components using Enzyme. | Questions about a comprehensive guide covering essentials, debugging, and advanced techniques for unit testing Preact components usin... |
examples/preact-unit-testing-with-enzyme-installation-commands.text | The npm installation commands required to set up enzyme and the preact adapter for unit testing. | Exact payloads, commands, or snippets shown in The npm installation commands required to set up enzyme and the preact adapter for unit testing. |
examples/preact-unit-testing-with-enzyme-preact-unit-testing-enzyme-configuration.text | A code example demonstrating how to configure Enzyme with a Preact adapter for unit testing. | Exact payloads, commands, or snippets shown in A code example demonstrating how to configure Enzyme with a Preact adapter for unit testing. |
examples/preact-unit-testing-with-enzyme-counter-component.text | A Preact functional component implementation of a counter used to demonstrate unit testing with Enzyme. | Exact payloads, commands, or snippets shown in A Preact functional component implementation of a counter used to demonstrate unit testing with Enzyme. |
examples/preact-unit-testing-with-enzyme-preact-unit-testing-enzyme-chai-counter-.text | A unit test suite using Enzyme and Chai to verify the rendering and click interaction of a Preact Counter component. | Exact payloads, commands, or snippets shown in A unit test suite using Enzyme and Chai to verify the rendering and click interaction of a Preact Counter component. |
examples/preact-unit-testing-with-enzyme-preact-unit-testing-enzyme-mount-shallow.text | Code examples demonstrating the use of enzyme's mount, shallow, and render methods for testing Preact components. | Exact payloads, commands, or snippets shown in Code examples demonstrating the use of enzyme's mount, shallow, and render methods for testing Preact components. |
examples/preact-unit-testing-with-enzyme.text | A code example demonstrating how to use the act function from preact/test-utils for unit testing components with Enzyme. | Exact payloads, commands, or snippets shown in A code example demonstrating how to use the act function from preact/test-utils for unit testing components with Enzyme. |
examples/preact-unit-testing-with-enzyme-preact-unit-testing-enzyme-mount-button-.text | A JavaScript test case demonstrating how to use Enzyme's mount function to simulate a button click and assert text changes in a Preact component. | Exact payloads, commands, or snippets shown in A JavaScript test case demonstrating how to use Enzyme's mount function to simulate a button click and assert text ch... |
What This Skill Covers
- Guide Version: 11.x (preview) 10.x (current) 8.x
- Main sections:
Introduction,Essentials,Debug & Test,Advanced,Libraries.
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://preactjs.com/guide/v10/unit-testing-with-enzyme