Principle:Nightwatchjs Nightwatch Component Plugin Installation
| Knowledge Sources | |
|---|---|
| Domains | Testing, Component_Testing, Plugin_System |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
A plugin installation pattern that extends a testing framework with framework-specific component rendering capabilities via separate packages.
Description
Component Plugin Installation adds the ability to render and test individual UI components in isolation, outside of a full application context. Unlike end-to-end tests which load complete pages, component tests mount a single component with controlled props and state. This requires framework-specific adapters (React, Vue, Angular) that handle component rendering, lifecycle management, and DOM integration.
The plugin architecture keeps the core testing framework lightweight while allowing users to install only the adapters they need for their specific frontend framework.
Usage
Install the appropriate component testing plugin when you need to test individual components in isolation. Choose based on your frontend framework: @nightwatch/react for React, @nightwatch/vue for Vue, @nightwatch/angular for Angular.
Theoretical Basis
The plugin system follows the extension point pattern:
- Core framework provides test execution, assertions, and browser control
- Plugins provide framework-specific rendering (mount/render)
- Bundler integration (Vite/Webpack) compiles components for browser execution
- Dev server serves compiled components to the browser