mcpbeat Sign in

Run Unit Tests Agent Skill

Run unit tests for the Cosmos Explorer project. Use this skill when asked to run tests, check test results, or debug test failures.

637 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
131
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/Azure/cosmos-explorer --skill run-unit-tests

The instruction itself

7 sections, as written by the author

Test Skill

Use the following commands to run unit tests for the Cosmos Explorer project.

Pre-Test: Check Dependencies

Before running tests, check whether npm install needs to be run:

if [ ! -d node_modules ] || [ package.json -nt node_modules ] || [ package-lock.json -nt node_modules ]; then
  npm install
fi

On Windows PowerShell:

if (-not (Test-Path node_modules) -or
    (Get-Item package.json).LastWriteTime -gt (Get-Item node_modules).LastWriteTime -or
    (Get-Item package-lock.json).LastWriteTime -gt (Get-Item node_modules).LastWriteTime) {
    npm install
}

Always run this check before proceeding with any test command.

Run All Unit Tests

Run the full test suite with coverage:

npm test

This clears the coverage/ directory and runs Jest with coverage collection enabled.

Run a Single Test File

Run a specific test file without coverage (faster):

npm run test:file -- path/to/file.test.ts

Run Tests in Debug Mode

Run tests serially (useful for debugging flaky or interdependent tests):

npm run test:debug

Run Tests Matching a Pattern

Run only tests whose names match a pattern:

npx jest --coverage=false --testPathPattern="SomeComponent"

Guidelines

  • When asked to simply "run tests" or "test", run npm test for the full suite.
  • When asked to test a specific file or component, use npm run test:file -- <path>.
  • When debugging test failures, use npm run test:debug to run serially.
  • Unit test files live adjacent to source files (Foo.test.ts next to Foo.ts in src/).
  • Tests use Jest with jest-environment-jsdom.
  • Use @testing-library/react for new component tests. Do not use Enzyme for new tests.
  • Use Jest built-in mocking, not sinon.js.
  • Coverage thresholds are enforced globally: branches 25%, functions 24%, lines 28%, statements 28%.
  • If tests fail, read the error output carefully. Common issues include:
  • Snapshot mismatches: Review the diff. If the change is intentional, update snapshots with npx jest --updateSnapshot.
  • Mock issues: Ensure mocks are set up correctly and reset between tests.
  • Import errors: Check that module name mappings in jest.config.js are correct.
  • Type errors in tests: Run npm run compile to check for TypeScript issues.

Other skills for the same job

different authors, same section of the catalogue
Webapp Testing
by anthropics
vendor ×12

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

6k tokens scripts
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
Test Driven Development
by w95
×7

Use when implementing any feature or bugfix, before writing implementation code

2k tokens
Systematic Debugging
by ratacat
×7

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

10k tokens scripts
Verification Before Completion
by ZhanlinCui
×6

Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

1k tokens
Backtest Expert
by BaggaT236
×3

Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.

15k tokens scripts
Adaptyv
by christophacham
×3

Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.

16k tokens
Aeon
by christophacham
×3

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

19k tokens

How to use it

Copy the folder

Take azure/run-unit-tests from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference npm, npx. Without those the skill loads but fails at the first command.