testing-n8n-testing
Test n8n nodes using Jest, nock for HTTP mocking, and local testing workflows with npm link. Use this skill when writing test files in __tests__ folders, mocking HTTP requests with nock, creating mock IExecuteFunctions contexts, testing helper functions, setting up golden file tests, running the linter before publishing, or locally testing nodes in the n8n UI. Apply when organizing test files, mocking external APIs, validating node execution output, or following the pre-publish checklist.
When & Why to Use This Skill
This Claude skill streamlines the automated testing and quality assurance process for n8n nodes. It provides a comprehensive framework for writing robust Jest test suites, mocking complex HTTP interactions with nock, and validating node execution logic. By automating pre-publish checklists and local testing workflows, it ensures high reliability and performance for custom n8n integrations.
Use Cases
- Unit Testing for n8n Nodes: Creating structured Jest test files in __tests__ folders to validate core node logic and helper functions.
- External API Mocking: Using nock to simulate various HTTP responses, including success states and error codes like 401, 404, or 429, ensuring nodes handle API failures gracefully.
- Execution Context Simulation: Creating mock IExecuteFunctions to test how nodes process data and interact with the n8n workflow engine.
- Regression Testing with Golden Files: Setting up golden file tests to compare complex node outputs against established benchmarks to prevent breaking changes.
- Local Development & Validation: Utilizing npm link and n8n dev mode for real-time testing in the UI, combined with linting checks to meet publishing standards.
| name | Testing N8n Testing |
|---|---|
| description | Test n8n nodes using Jest, nock for HTTP mocking, and local testing workflows with npm link. Use this skill when writing test files in __tests__ folders, mocking HTTP requests with nock, creating mock IExecuteFunctions contexts, testing helper functions, setting up golden file tests, running the linter before publishing, or locally testing nodes in the n8n UI. Apply when organizing test files, mocking external APIs, validating node execution output, or following the pre-publish checklist. |
When to use this skill:
- When creating test files in tests/ folders
- When writing Jest test suites for n8n nodes
- When mocking HTTP requests with nock (beforeAll, afterEach, afterAll patterns)
- When testing helper functions for data formatting
- When creating mock IExecuteFunctions for node execution tests
- When verifying node output against expected results
- When testing API error handling (401, 404, 429 responses)
- When setting up golden file tests for complex output
- When linking nodes locally for manual testing (npm link)
- When using n8n dev mode with hot reload
- When running npm run lint before publishing
- When following the pre-publish checklist (tests pass, build succeeds, manual testing)
- When testing credentials save and validation in n8n UI
Testing N8n Testing
This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle testing n8n testing.
Instructions
For details, refer to the information provided in this file: testing n8n testing