Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test(NODE-7183): migrate integration/gridfs tests #4677

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

Open
tadjik1 wants to merge 4 commits into main
base: main
Choose a base branch
Loading
from NODE-7183
Open

Conversation

Copy link
Contributor

@tadjik1 tadjik1 commented Sep 24, 2025
edited
Loading

Description

Summary of Changes

This PR migrates the integration tests for gridfs. The changes include:

  • Big refactoring for stream tests (removing duplicates, using async/await, and modern Node.js utilities to work with streams)
  • Import directly from the src folder, convert .js into .ts
Notes for Reviewers

To simplify the review process, this PR is split into several commits:

  • Several commits only contain small changes (up to 8 lines) with either types or imports or linter fixes
  • The biggest commit contains all the refactoring, I put extra effort to avoid structural changes (I hope it will still be possible to compare changes line by line or at least block by block). Please let me know if you would want me to split this commit into smaller chunks.

Those tests are quite old, some of them test callbacks and promises API separately, that's why I have removed a few.

What is the motivation for this change?

This work is part of a larger, ongoing initiative to convert all tests to use async/await, with the ultimate goal of removing the legacy driver wrapper.

Double check the following

  • Lint is passing (npm run check:lint)
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@tadjik1 tadjik1 changed the title (削除) test(NODE-7183): import from src (削除ここまで) (追記) test(NODE-7183): migrate integration/gridfs tests (追記ここまで) Sep 24, 2025
@tadjik1 tadjik1 marked this pull request as ready for review September 24, 2025 14:49
@tadjik1 tadjik1 requested a review from a team as a code owner September 24, 2025 14:49
* @example-class GridFSBucket
* @example-method delete
*/
it('Deleting a file using promises', function (done) {
Copy link
Contributor Author

@tadjik1 tadjik1 Sep 24, 2025
edited
Loading

Choose a reason for hiding this comment

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

Removed completely as we only support promises and previous test in the same file already covers this functionality.

baileympearson reacted with thumbs up emoji
* @example-class GridFSBucket
* @example-method drop
*/
it('drop using promises', {
Copy link
Contributor Author

@tadjik1 tadjik1 Sep 24, 2025
edited
Loading

Choose a reason for hiding this comment

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

Removed completely as we only support promises and previous test in the same file already covers this functionality.

}
});

it('should correctly handle indexes create with BSON.Double', function (done) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed completely as Double can't be passed as IndexDirection, please let me know if this test is needed in some form (maybe in different module).

@tadjik1 tadjik1 marked this pull request as draft September 24, 2025 15:46
@tadjik1 tadjik1 marked this pull request as ready for review September 24, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /