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

Migrate reflectionEquals tests #527

Merged
merged 15 commits into from
May 1, 2023
Merged

Conversation

smaye81
Copy link
Collaborator

@smaye81 smaye81 commented Apr 29, 2023

This migrates the reflection-equals tests to the test-generated package and removes its dependence on fixtures.

@smaye81 smaye81 requested a review from timostamm April 29, 2023 00:38
@smaye81
Copy link
Collaborator Author

smaye81 commented Apr 29, 2023

@timostamm lmk what you think about this coverage. The spec already covers a bit of the equals logic. I added a few checks on the generated code for enums, oneofs, and maps.

packages/test-generated/spec/reflection-equals.spec.ts Outdated Show resolved Hide resolved
const mt = new MessageType<UnknownMessage>(mi.typeName, mi.fields, mi.options);
const message = reflectionCreate(mt);
reflectionMergePartial(mi, message, msg);
expect(true).toBeTrue();
Copy link
Owner

Choose a reason for hiding this comment

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

I hope true is always true 🙂

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ack, my mistake.

@smaye81
Copy link
Collaborator Author

smaye81 commented Apr 30, 2023

@timostamm updated. I also had to remove any messages setting BigInt because of how we generate different types for those values based on plugin options. Lmk if there's a better way and/or a way to test the BigInt fields.

Copy link
Owner

@timostamm timostamm left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants