test-affected

Run tests for packages affected by current branch changes using Nx.

38|15|Updated Jul 26, 2023
One-click install
npx skills add https://github.com/sisense/compose-sdk-monorepo --skill test-affected
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-affected
Source: https://github.com/sisense/compose-sdk-monorepo/tree/main/.claude/skills/test-affected
Command: npx skills add https://github.com/sisense/compose-sdk-monorepo --skill test-affected

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill reduces feedback time by running tests only for packages affected by the current branch, avoiding unnecessary full-repo test runs.

Core Features & Use Cases

  • Selective testing: detects and tests only impacted packages using the Nx dependency graph.
  • MR-ready validation: ensures changed code passes tests before submitting a merge request.
  • Flexible scope: supports single-package and multi-package test scenarios via $ARGUMENTS.

Quick Start

Provide package names via the $ARGUMENTS placeholder and run the affected tests workflow.

Frequently Asked Questions about test-affected

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run tests only for packages affected by current branch changes in an Nx monorepo?

To run affected tests in an Nx monorepo, use the Nx affected graph with baseline and head options to detect changed code and validate only the impacted packages, significantly reducing feedback time during development.

What is selective testing for impacted packages in a monorepo?

Selective testing for impacted packages uses the Nx dependency graph to identify and run tests only for projects affected by your current branch changes, avoiding unnecessary full-repo test runs and accelerating MR-ready validation.

How do I test multiple packages affected by changes in my CI workflow?

To test multiple affected packages in your CI workflow, provide the specific package names via the $ARGUMENTS placeholder to execute the targeted tests, ensuring changed code passes validation before submitting a merge request.

Can I use Nx affected test commands for single-package validation before a merge request?

Yes, you can use Nx affected test commands for single-package validation by passing the package name through $ARGUMENTS, ensuring the changed code passes tests before submitting a merge request without running the full test suite.

What's the best way to reduce test feedback time in large monorepos?

The best way to reduce test feedback time in large monorepos is to run tests only for packages affected by the current branch using the Nx affected graph, avoiding unnecessary full-repo test runs and validating only impacted code.

Do I need to run builds to ensure correct validation when testing affected packages?

You can rely on optional builds alongside nx test commands, baseline, and head options to ensure correct validation when testing affected packages, ensuring changed code passes tests before submitting a merge request.