Skip to content

test: add coverage for includesModifier - #1060

Open
DatenpflegeNordHL wants to merge 3 commits into
typescript-eslint:mainfrom
DatenpflegeNordHL:test/includes-modifier-issue-12
Open

DatenpflegeNordHL wants to merge 3 commits into
typescript-eslint:mainfrom
DatenpflegeNordHL:test/includes-modifier-issue-12

Conversation

@DatenpflegeNordHL

@DatenpflegeNordHL DatenpflegeNordHL commented Oct 25, 2026 •

Copy link
Copy Markdown

PR Checklist

Overview

Fixes #12.

includesModifier is the only function in src/modifiers.ts and had no tests.
This adds src/modifiers.test.ts with eight Vitest cases that build modifiers via ts.factory:

  1. undefined modifiers return false
  2. an empty iterable returns false
  3. no matching modifier returns false
  4. a match after a non-matching modifier returns true
  5. any of several requested kinds matches
  6. no requested kinds returns false
  7. a non-array iterable (Set) is accepted
  8. a decorator (a ModifierLike but not a modifier kind) does not match

No source changes.

Checks run locally after merging the latest main (Node 26.12.1, pnpm 10.34.4, pnpm install --frozen-lockfile):

  • pnpm run test --coverage --run: 17 files, 326 tests passed with TypeScript 5.5.4, 5.9.3 and 6.0.3
  • pnpm build, node ./lib/index.mjs, pnpm run lint:package: passed
  • pnpm tsc, pnpm lint, pnpm lint:docs, pnpm lint:knip, pnpm lint:md, pnpm lint:packages, pnpm lint:spelling: passed
  • pnpm format --list-different: no differences

I haven't run the other Node versions of the CI matrix locally.

AI-assisted development disclosure: This change was developed with AI coding assistance (Anthropic Claude via Claude Code). Every change was reviewed, tested and, where needed, revised by a human developer at DatenpflegeNord, who takes full responsibility for this contribution. We disclose AI assistance for transparency, following the transparency principles of the EU AI Act.

💖

DatenpflegeNordHL and others added 3 commits October 25, 2026 13:56
Apply the project's Prettier formatting and use "non-matching" so cspell passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DatenpflegeNordHL

Copy link
Copy Markdown
Author

Merged the latest main into this branch. The earlier workflow runs never started any jobs. Could a maintainer approve the workflow runs? Locally on Node 26 the tests pass with TypeScript 5.5.4, 5.9.3 and 6.0.3, and build, tsc, lint, prettier, cspell, knip, markdownlint, typedoc and publint are clean.

This branch has not been deployed

No deployments
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.

🧪 Tests: Add tests for remaining functions in modifiers.ts

1 participant