Skip to content

feat: v1.1.0 — coverage(), suggest(), boundaries.custom()#2

Merged
i-kosheliev merged 5 commits into
mainfrom
feature/434-cli-scanner
Apr 16, 2026
Merged

feat: v1.1.0 — coverage(), suggest(), boundaries.custom()#2
i-kosheliev merged 5 commits into
mainfrom
feature/434-cli-scanner

Conversation

@i-kosheliev

Copy link
Copy Markdown
Owner

New features

  • coverage(tests, requirements) — check requirements coverage with Jaccard similarity
  • suggest(description) — pattern-based test improvement suggestions (12 patterns)
  • boundaries.custom(rules) — define domain-specific valid/invalid/boundary values

180 tests passed, zero dependencies.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

i-kosheliev and others added 5 commits April 14, 2026 01:43
npx @iklab/testkit scan ./tests — analyzes test files for:
- Flaky code patterns (setTimeout, fetch, Date.now, Math.random, process.env, fs I/O)
- Missing assertions (test bodies without expect/assert)
- Conditional assertions (expect inside if/else)
- Focused tests (.only) and skipped tests (.skip, x-prefix)
- Duplicate test names across files (Jaccard similarity)
- Flaky descriptions (reuses existing flaky() function)

Architecture: AST-based using acorn + @sveltejs/acorn-typescript.
Two-tier analysis: structure extraction + code body scanning.
Text output with ANSI colors + --json flag for CI.
Exit codes: 0 clean, 1 issues found, 2 fatal error.

24 new tests (scanner.test.ts), 150 total passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. process.env: changed isMemberCall to isMemberAccess — was checking
   for process.env() (CallExpression) instead of process.env.X
   (MemberExpression). Pattern never triggered before this fix.
2. Symlink cycle protection: walkDir now tracks visited real paths
   via realpathSync() + Set. Max depth 50 prevents stack overflow.
3. File size limit: CLI skips files > 5MB to prevent OOM on huge
   generated files.
4. New test: process.env detection in flaky fixture.

151 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9 new tests:
- globToRegex: wildcard, question mark, dot escaping, exact match
- text-reporter: header, clean report, summary stats
- json-reporter: valid JSON, all sections present

Also exported globToRegex for testing.
160 total tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New features:
- coverage(tests, requirements) — check requirements coverage with Jaccard similarity
- suggest(description) — pattern-based test improvement suggestions (12 patterns)
- boundaries.custom(rules) — define domain-specific valid/invalid/boundary values

180 tests, zero dependencies, TypeScript-first.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@i-kosheliev i-kosheliev merged commit dc7eea6 into main Apr 16, 2026
@i-kosheliev i-kosheliev deleted the feature/434-cli-scanner branch April 16, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant