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

test: Promisify basic tests #1018

Merged
merged 4 commits into from
Sep 25, 2022

Conversation

albertpurnama
Copy link
Contributor

@albertpurnama albertpurnama commented Aug 7, 2022

General Description

This PR is supposed to cover tests in here .

Link to discussion

TODOs

  • File structure to map with node's functions.
  • Promisify tests

@github-actions github-actions bot added the needs tests Something that needs more testing label Aug 7, 2022
);
})

// TODO: common.mustCall
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Up to this point I decided to stop working on this test for now since it requires common.mustCall to be implemented for further testing.

Should I do this first?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it will be valuable to land more tests into one PR and address the gaps as a follow up issue.
We will get a better understanding of what are the gaps by that point of time.

Copy link
Contributor

Choose a reason for hiding this comment

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

Another idea is to use similar strategy as used here

expect(called).toBe(false);

as an alternative of common.mustCall

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm I see, I'll see what I can do with that. Thank you for the reference!

);
})

// TODO: common.mustCall
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it will be valuable to land more tests into one PR and address the gaps as a follow up issue.
We will get a better understanding of what are the gaps by that point of time.

@@ -0,0 +1,81 @@
import { describe, it } from "bun:test";
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add the license header from the node tests into this?

@albertpurnama
Copy link
Contributor Author

Hey @soneymathew, I've requested review again!

The error object returned from invalid input (see last test case) doesn't match from NodeJS's promisify. I wonder if this is intentional or missing implementation from bun?

@albertpurnama albertpurnama marked this pull request as ready for review August 24, 2022 06:04
@Jarred-Sumner Jarred-Sumner merged commit 2819509 into oven-sh:main Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs tests Something that needs more testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants