Skip to content

🧪 Testing: Fill in test coverage for augmentOptionsWithExcludes #699

Closed
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

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

#695 added a bunch of code changes. I didn't fully unit test them - not because I was too impatient to write tests (me?! never!!), but because I wanted to leave some good first issues as followups. Definitely that.

augmentOptionsWithExcludes is missing unit test coverage for several dozen lines one or two lines. augmentOptionsWithExcludes.test.ts only tests the case of fully automated usage. It doesn't test what happens when the user is prompted for anything. Let's add tests to augmentOptionsWithExcludes.test.ts that exercise the calls to prompt!

Additional Info

You'll likely need to use Vitest mocking - specifically, vi.mock. Search for vi.mock("@clack/prompts" in code to see how other unit tests accomplish this.

We don't need complete 100% unit test coverage of the file. If the tests are giving you grief, feel free to send an incomplete Draft PR with comments asking for help. ❤️


Note that the code might have been refactored since this issue was filed. Names might be slightly off. The general spirit of this issue should still be valid though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: testingImproving how the repository's tests are run and/or code is testedgood first issueGood for newcomers, please hop on!status: accepting prsPlease, send a pull request to resolve this!type: cleanupTech debt or other code/repository cleanups

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions