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

Avoid jest#13535 and planttheidea/fast-equals#91 #515

Closed
PSanetra opened this issue Oct 30, 2022 · 0 comments · Fixed by #516
Closed

Avoid jest#13535 and planttheidea/fast-equals#91 #515

PSanetra opened this issue Oct 30, 2022 · 0 comments · Fixed by #516

Comments

@PSanetra
Copy link
Contributor

Describe the Bug
CloudEvent class instances are at the moment not comparable using some popular libraries. Instances might be considered equal although they are not equal.

See the following issues:

Steps to Reproduce

  1. Create two CloudEvent instances with different data properties
  2. Pass the instances to expect(...).toStrictEqual(...) of jest and to circularDeepEqual(...) of the fast-equals library
  3. Both calls will consider those CloudEvent instances to be equal although they are not equal

Expected Behavior
Both instances should not be considered equal using those libraries.

How to fix
I think the best way to avoid this issue is to avoid using private javascript fields and use private Typescript fields instead.

PSanetra added a commit to PSanetra/cloudevents-sdk-javascript that referenced this issue Oct 31, 2022
….keys() (cloudevents#515)

Signed-off-by: Philip Sanetra <code@psanetra.de>
PSanetra added a commit to PSanetra/cloudevents-sdk-javascript that referenced this issue Oct 31, 2022
….keys() (cloudevents#515)

Signed-off-by: Philip Sanetra <code@psanetra.de>
PSanetra added a commit to PSanetra/cloudevents-sdk-javascript that referenced this issue Oct 31, 2022
….keys() (cloudevents#515)

Signed-off-by: Philip Sanetra <code@psanetra.de>
PSanetra added a commit to PSanetra/cloudevents-sdk-javascript that referenced this issue Oct 31, 2022
….keys() (cloudevents#515)

Signed-off-by: Philip Sanetra <code@psanetra.de>
PSanetra added a commit to PSanetra/cloudevents-sdk-javascript that referenced this issue Nov 1, 2022
….keys() (cloudevents#515)

Signed-off-by: Philip Sanetra <code@psanetra.de>
lance pushed a commit that referenced this issue Nov 1, 2022
….keys() (#515) (#516)

Signed-off-by: Philip Sanetra <code@psanetra.de>
@lance lance closed this as completed in #516 Nov 1, 2022
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 a pull request may close this issue.

1 participant