tests

Installation
SKILL.md

JavaScript/TypeScript Rule Test Structure

Test File Location

Test files for rules are located alongside the rule implementation:

  • unit.test.ts - Unit tests using the rule tester
  • Test fixtures in packages/analysis/src/jsts/rules/{RULE_ID}/fixtures/ (if applicable)

Test Structure

Tests use the ESLint rule tester pattern with valid and invalid arrays:

import { rule } from './index.js';
import { DefaultParserRuleTester } from '../../../tests/tools/testers/rule-tester.js';
import { describe, it } from 'node:test';
Installs
4
GitHub Stars
1.2K
First Seen
Mar 19, 2026
tests — sonarsource/sonarjs