Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Nightwatchjs Nightwatch Component Plugin Install

From Leeroopedia
Knowledge Sources
Domains Testing, Component_Testing, Plugin_System
Last Updated 2026-02-12 00:00 GMT

Overview

External npm packages that enable component testing for specific frontend frameworks within Nightwatch.js.

Description

The component testing plugins (@nightwatch/react, @nightwatch/vue, @nightwatch/angular) are separate npm packages that extend Nightwatch with render and mount functions for their respective frameworks. These are external to the nightwatch repository and must be installed as dev dependencies. Each plugin requires its corresponding bundler plugin (e.g., @vitejs/plugin-react for React with Vite).

Usage

Install the plugin matching your frontend framework. Only one framework plugin is typically needed per project.

Code Reference

Source Location

  • Repository: nightwatch (plugin referenced in configuration)
  • File: package.json (devDependencies section)

Signature

# React component testing
npm install @nightwatch/react --save-dev

# Vue component testing
npm install @nightwatch/vue --save-dev

# Angular component testing
npm install @nightwatch/angular --save-dev

Import

# No code import - plugins are registered in nightwatch.conf.js
# plugins: ['@nightwatch/react']

I/O Contract

Inputs

Name Type Required Description
Plugin package name string Yes @nightwatch/react, @nightwatch/vue, or @nightwatch/angular
Bundler Package Yes vite or webpack must be installed
Bundler plugin Package Yes Framework-specific Vite/Webpack plugin (e.g., @vitejs/plugin-react)

Outputs

Name Type Description
Plugin installed npm package Plugin available for nightwatch.conf.js plugins array
render/mount functions Functions Component rendering functions available in tests

Usage Examples

Install React Plugin

# Install Nightwatch React plugin and Vite dependencies
npm install @nightwatch/react --save-dev
npm install vite @vitejs/plugin-react --save-dev

# Add to nightwatch.conf.js:
# plugins: ['@nightwatch/react']

Install Vue Plugin

# Install Nightwatch Vue plugin and Vite dependencies
npm install @nightwatch/vue --save-dev
npm install vite @vitejs/plugin-vue --save-dev

# Add to nightwatch.conf.js:
# plugins: ['@nightwatch/vue']

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment