Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs.test.ts: Improve readbility, add types to fix TS problems #1482

Merged
merged 8 commits into from
Oct 21, 2023

Conversation

weedySeaDragon
Copy link
Contributor

addresses #1481

  1. Improve readability to make it easier for readers to use tests to understand the generator code / use the tests as specifications

    • I created constants to use as array indices so that the intent is explicit.
  2. Fix TypeScript problems: Added, defined types where needed.

  • In order to use ejs Data type for templates, had to explicitly include @types/ejs and ejs in the package.
  • GeneratorOptions requires help: be included; added it to a new Generator.... call where it was missing
  • I had to add a @ts-expect-error comment for a line where esmocha.spyOn(...) is used. I referenced the known GitHub issue. I added a comment noting that the spyOn could be replaced with a sinonStub(), since the result of the spy is never checked.

I did not squash my commits. I thought it might be helpful to see exactly what changes I made.

Copy link
Member

@mshima mshima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great thanks.

@mshima mshima merged commit 3dd4c2d into yeoman:main Oct 21, 2023
6 of 7 checks passed
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.

None yet

2 participants