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

refactor: modernize HTTPRequest tests #7604

Merged
merged 6 commits into from
Oct 8, 2021
Merged

refactor: modernize HTTPRequest tests #7604

merged 6 commits into from
Oct 8, 2021

Conversation

brandongregoryscott
Copy link
Contributor

New Pull Request Checklist

Issue Description

Refactor some existing tests to use async/await as described in #7563. Additionally, removes unnecessary done callbacks, and fixes some deprecation warnings with the Buffer constructor.

Related issue: Modernize Codebase #7563

Approach

Tests were refactored using a red/green testing strategy. All functionality/guards of the tests should remain the same.

TODOs before merging

None that I am aware of

@parse-github-assistant
Copy link

parse-github-assistant bot commented Oct 3, 2021

Thanks for opening this pull request!

  • ❌ Please edit your post and use the provided template when creating a new pull request. This helps everyone to understand your post better and asks for essential information to quicker review the pull request.

@brandongregoryscott brandongregoryscott changed the title Modernize HTTPRequest tests refactor: Modernize HTTPRequest tests Oct 3, 2021
@dblythy
Copy link
Member

dblythy commented Oct 3, 2021

Yay! Thanks for this, i'm glad to see someone else working towards cleaning up the tests 🎉

@brandongregoryscott
Copy link
Contributor Author

Yay! Thanks for this, i'm glad to see someone else working towards cleaning up the tests 🎉

Of course! Happy to help out. Let me know if there's anything I missed or could be written a better way 😃

@dblythy
Copy link
Member

dblythy commented Oct 3, 2021

I would normally say to prefer expectAsync.toBeRejectedWith but I know with HTTP errors it's pretty much impossible to expect the full error response.

The other point I would make is to prefer template literal syntax in the URL request. But other than that looks good!

@codecov
Copy link

codecov bot commented Oct 3, 2021

Codecov Report

Merging #7604 (32368a7) into master (caee281) will increase coverage by 0.00%.
The diff coverage is n/a.

❗ Current head 32368a7 differs from pull request most recent head ba97e90. Consider uploading reports for the commit ba97e90 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7604   +/-   ##
=======================================
  Coverage   93.94%   93.95%           
=======================================
  Files         181      181           
  Lines       13319    13319           
=======================================
+ Hits        12513    12514    +1     
+ Misses        806      805    -1     
Impacted Files Coverage Δ
src/ParseServerRESTController.js 97.01% <0.00%> (-1.50%) ⬇️
src/RestWrite.js 94.20% <0.00%> (+0.15%) ⬆️
src/Adapters/Files/GridFSBucketAdapter.js 80.32% <0.00%> (+0.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update caee281...ba97e90. Read the comment docs.

@dblythy dblythy requested a review from a team October 8, 2021 12:14
Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Nice! Code modernization is too often overlooked unfortunately, even more glad to see this PR!

@parse-github-assistant
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title refactor: Modernize HTTPRequest tests refactor: modernize HTTPRequest tests Oct 8, 2021
@mtrezza mtrezza requested review from mtrezza and removed request for mtrezza October 8, 2021 15:34
@brandongregoryscott
Copy link
Contributor Author

Thanks for cleaning up the changelog & title! 😃

@mtrezza mtrezza merged commit 197fcbd into parse-community:master Oct 8, 2021
@brandongregoryscott brandongregoryscott deleted the modernize-httprequest-spec branch October 8, 2021 22:26
@dblythy
Copy link
Member

dblythy commented Oct 9, 2021

@brandongregoryscott if you would like to help with the modernization, cleaning up the tests really help. It gets a little more difficult with core code as we don't want to introduce huge merge conflicts that discourage open PRs. If you're thinking of cleaning up any code, feel free to open a draft PR at its inception and we can discuss if it's good to go, or if it's better to wait until conflicting PRs are merged.

Thanks again for this PR and welcome to the Parse Contributor community 😃

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Nov 1, 2021
@mtrezza mtrezza mentioned this pull request Mar 12, 2022
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants