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

docs: add/improve our command warnings #406

Merged
merged 7 commits into from
Dec 16, 2021
Merged

docs: add/improve our command warnings #406

merged 7 commits into from
Dec 16, 2021

Conversation

kanadgupta
Copy link
Member

@kanadgupta kanadgupta commented Dec 15, 2021

🧰 Changes

  • Added a warning for when someone uses the openapi command with both a version and id parameter, since the version parameter is ignored in this case. This has created a lot of confusion for users so hopefully this warning should provide some clarification
    • Added a test for this
  • Enhanced language and formatting in several warnings 🟡 (one potential enhancement idea: what if we had an ESLint rule or something that prevented us from using console.warn and instead we had to use a standard shared chalk-formatted logger function? cc: @erunion)
  • Updated a test to test against our openapi command and refreshed its corresponding snapshot (see this comment)

🧬 QA & Testing

Do tests pass?

Comment on lines -72 to +80
await expect(cli(['swagger', '--help'])).resolves.toMatchSnapshot();
await expect(cli(['openapi', '--help'])).resolves.toMatchSnapshot();
});

it('should print usage for a given command if supplied as `help <command>`', async () => {
await expect(cli(['help', 'swagger'])).resolves.toMatchSnapshot();
await expect(cli(['help', 'openapi'])).resolves.toMatchSnapshot();
});

it('should not surface args that are designated as hidden', async () => {
await expect(cli(['swagger', '--help'])).resolves.toMatchSnapshot();
await expect(cli(['openapi', '--help'])).resolves.toMatchSnapshot();
Copy link
Member Author

Choose a reason for hiding this comment

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

I figured it makes more sense to test our openapi command rather than our deprecated swagger command here, which resulted in a bunch of snapshot updates in __tests__/__snapshots__/index.test.js.snap.

@kanadgupta kanadgupta marked this pull request as ready for review December 16, 2021 18:37
@kanadgupta kanadgupta added documentation Improvements or additions to documentation enhancement New feature or request labels Dec 16, 2021
@kanadgupta kanadgupta requested a review from erunion December 16, 2021 18:37
@erunion erunion merged commit 2228c2c into main Dec 16, 2021
@erunion erunion deleted the fix/console-warnings branch December 16, 2021 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants