Skip to content

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.

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.

3 participants