docs: Document how to generate and visualize test coverage locally (no-changelog) (#15385)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-06-03 19:31:53 +02:00
committed by GitHub
parent 1e92729492
commit c09b67b232
4 changed files with 27 additions and 12 deletions

View File

@@ -19,9 +19,14 @@ Great that you are here and you want to contribute to n8n
- [Actual n8n setup](#actual-n8n-setup)
- [Start](#start)
- [Development cycle](#development-cycle)
- [Community PR Guidelines](#community-pr-guidelines)
- [Community PR Guidelines](#community-pr-guidelines)
- [**1. Change Request/Comment**](#1-change-requestcomment)
- [**2. General Requirements**](#2-general-requirements)
- [**3. PR Specific Requirements**](#3-pr-specific-requirements)
- [**4. Workflow Summary for Non-Compliant PRs**](#4-workflow-summary-for-non-compliant-prs)
- [Test suite](#test-suite)
- [Unit tests](#unit-tests)
- [Code Coverage](#code-coverage)
- [E2E tests](#e2e-tests)
- [Releasing](#releasing)
- [Create custom nodes](#create-custom-nodes)
@@ -253,6 +258,10 @@ tests of all packages.
If you made a change which requires an update on a `.test.ts.snap` file, pass `-u` to the command to run tests or press `u` in watch mode.
#### Code Coverage
We track coverage for all our code on [Codecov](https://app.codecov.io/gh/n8n-io/n8n).
But when you are working on tests locally, we recommend running your tests with env variable `COVERAGE_ENABLED` set to `true`. You can then view the code coverage in the `coverage` folder, or you can use [this VSCode extension](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters) to visualize the coverage directly in VSCode.
#### E2E tests
⚠️ You have to run `pnpm cypress:install` to install cypress before running the tests for the first time and to update cypress.