-
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
refactor(open/openapi/validate): return promises, fix tests #410
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- console.info is so we can safely use console.log() statements when debugging more easily - returning the value allows us to write more robust tests
idk, this just felt weird... i hate JS
- returning the value allows us to write more robust tests
- console.info() makes it so it's easier for us to use console.log while debugging - returning the promise allows us to write more robust tests
This reverts commit afeaf7b. For the sake of confining the scope of these changes, I'm reverting this and will fix this in a separate PR focused on our docs commands.
erunion
approved these changes
Dec 21, 2021
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.
super minor comments but these are all great refactors
Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧰 Changes
This rabbit hole of work is a continuation of the work started in #407 where I'm combing through and making sure we're returning resolved/rejected promises wherever possible and updating/standardizing our test suite patterns to ensure better coverage and to make debugging easier. In an effort to keep this PR easy to review (since most of the diff is just testbed refactors), I'm going to only include a few command refactors here:
open
console.log
mocksopenapi
console.log
mocksconsole
mocks since I figured we'd still want to check for certain console outputs, but I refactored them to beconsole.info
andconsole.warn
calls so we can safely useconsole.log
for our own debugging.validate
console.log
mocksopenapi
command above, we're now usingconsole.info
instead.In separate PRs, I'll be doing the following:
console.info
andconsole.warn
calls in our main codebase, but nothing else. That way we can safely useconsole.log
when debugging and not worry about a test mock eating it up.bin/rdme
)docs
commands that I discovered when performing similar refactors there🧬 QA & Testing
Note that this PR doesn't actually fix any bugs in the main codebase itself, just standardizes our patterns and fixes a few test suite issues. If tests pass and you can run the above commands as expected, then we should be good to go.