typescript-eslint / typescript-eslint/ts-api-utils

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

Open
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: testing good first issue status: accepting prs
Dominant language
TypeScript
Stars
122
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Bug Report Checklist
  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.
Overview

#6 added a first round of unit tests. Let's add some more tests! 🙌

The src/syntax.ts file is not yet tested. This issue tracks adding in tests for its exported functions.

Additional Info

See #6 for examples of tests: including those that work with AST nodes and/or type checking.

There might be existing tests in https://github.com/ajafff/tsutils that are relevant here. If you do find them, it's fine to copy & paste them over - as long as there's a comment like this above any area of copy & pasted code (or on top of a file if the entire file is copy & pasted):

// Code largely based on https://github.com/ajafff/tsutils
// Original license: https://github.com/ajafff/tsutils/blob/26b195358ec36d59f00333115aa3ffd9611ca78b/LICENSE

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the exported functions in src/syntax.ts and review issue #6 for the existing unit-test patterns. Add tests covering the remaining functions, including AST-node or type-checking cases where relevant, and use the referenced tsutils tests only with the required attribution; done means the exported functions have meaningful test coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.