-
Notifications
You must be signed in to change notification settings - Fork 44
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
test(openapi/validate): rewrite tests to be more comprehensive #1188
Conversation
}); | ||
|
||
beforeEach(() => { | ||
consoleInfoSpy = vi.spyOn(console, 'info').mockImplementation(() => {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we were previously handrolling mocks for console.info
in addition to the console output mocking we get via @oclif/test
. what a mess
@@ -148,22 +121,15 @@ describe('rdme openapi validate', () => { | |||
}); | |||
|
|||
it('should create GHA workflow if user passes in spec via prompts', async () => { | |||
expect.assertions(6); | |||
expect.assertions(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we bother with expect.assertions
at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i went back and forth here, they do seem unnecessary. i'll remove 'em
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
🎉 This PR is included in version 10.2.0-next.5 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
## 🧰 Changes continuing my work in #1188 with even more work to migrate over our tests to the more comprehensive `runCommand` helper: - [x] `openapi convert` - [x] `openapi inspect` - [x] `openapi reduce` - [x] `login` - [x] `logout` - [x] `whoami` the only outstanding tests using the now deprecated `runCommandAndReturnResult` helper are the changelog tests, but i'll swap those out if/when we get around to migrating that command over to APIv2. ## 🧬 QA & Testing no functional changes. do tests still pass?
🧰 Changes
rewrites our tests for
openapi validate
to be more compliant with our contributing guidelines. i initially wrote them this way to minimize the amount of legwork to getoclif
working but this approach to testing is far more comprehensive and it should be much easier to drop in stray console logs for debugging purposes.🧬 QA & Testing
do tests still pass?