Skip to content
Back to skills

Run Test

ASecurity

Run tests. Supports running all tests, single file, or pattern-matched tests.

  • 564 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 26, 2026
testingbashnodedatabase

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add mx-space/core --skill run-test --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Run Test?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Run Test
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mx-space-run-test/badge)](https://www.skillsdirectory.com/skills/mx-space-run-test)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: run-test
description: Run tests. Supports running all tests, single file, or pattern-matched tests.
argument-hint: [file-path|pattern]
disable-model-invocation: true
allowed-tools: Bash(pnpm test*), Bash(cd *), Read, Glob
---

# Run Tests

Run project tests. Arguments: `$ARGUMENTS`

## Test Commands

### Run All Tests

```bash
pnpm test
```

### Run Single Test File

```bash
# Using relative path (from apps/core directory)
pnpm test -- test/src/modules/post/post.controller.e2e-spec.ts

# Using filename pattern
pnpm test -- --testNamePattern="PostController"
```

### Watch Mode

```bash
pnpm -C apps/core run test:watch
```

### Run Specific Test Case

```bash
# Match test name
pnpm test -- --testNamePattern="should create post"
```

## Test Directory Structure

```
apps/core/test/
├── src/
│   ├── modules/           # Module tests
│   │   ├── post/
│   │   │   ├── post.controller.e2e-spec.ts
│   │   │   └── post.e2e-mock.db.ts
│   │   ├── user/
│   │   │   ├── user.controller.spec.ts
│   │   │   ├── user.controller.e2e-spec.ts
│   │   │   └── user.service.spec.ts
│   │   └── ...
│   ├── utils/             # Utility tests
│   ├── processors/        # Processor tests
│   └── transformers/      # Transformer tests
├── helper/                # Test helpers
├── mock/                  # Mock implementations
└── setup-global.ts        # Global setup
```

## Test Types

| Suffix | Type | Description |
|--------|------|-------------|
| `.spec.ts` | Unit test | Test single function or class |
| `.e2e-spec.ts` | E2E test | Test complete HTTP request flow |

## Execution Steps

1. Analyze arguments to determine which tests to run
2. If file path specified, verify file exists first
3. Execute appropriate test command
4. Report test results

## Common Issues

### Test Timeout

Increase timeout:

```bash
pnpm test -- --testTimeout=30000
```

### Memory Issues

Tests use in-memory database. If memory issues occur:

```bash
NODE_OPTIONS="--max-old-space-size=4096" pnpm test
```

### Run Only Failed Tests

```bash
pnpm test -- --reporter=verbose
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.