Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/preact-unit-testing-with-enzyme-workflow-guide.mdA 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.textThe 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.textA 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.textA 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-.textA 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.textCode 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.textA 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-.textA 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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