Skip to content

Absorb the unexpected-set plugin #783

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

Merged
merged 5 commits into from
Apr 26, 2022
Merged

Conversation

papandreou
Copy link
Member

@papandreou papandreou commented Dec 20, 2020

SLUUUURRRP! 🤤

Excluding the <array-like> with set semantics <assertion?> assertion which I think is a bit too opinionated/obscure for core.

TODO:

  • Maybe enhance <Set> [not] to contain <any> to take varargs like <array-like> [not] to contain <any+> and <string> [not] to contain <string+>. (Or remove the ability from the other ones, it might be a bit obscure)
  • Figure out the equality semantics. Set#has uses the SameValueZero algorithm, but we should probably plug in unexpected's own equal in some cases, such as to contain. Right now this fails: expect(new Set([new Date('2020-01-01T12:34:56.789Z')]), 'to contain', new Date('2020-01-01T12:34:56.789Z'));

@papandreou papandreou self-assigned this Dec 20, 2020
@sunesimonsen
Copy link
Member

sunesimonsen commented Dec 20, 2020

Or remove the ability from the other ones, it might be a bit obscure

I think varargs is more okay now that you can do array splatting, so I don't think we should remove it.

@papandreou papandreou force-pushed the feature/absorbUnexpectedSet branch from 778dd56 to 391a3e0 Compare December 20, 2020 15:29
@papandreou papandreou force-pushed the feature/absorbUnexpectedSet branch from 5053b30 to dfefba1 Compare December 20, 2020 16:31
@papandreou papandreou merged commit 230a54b into master Apr 26, 2022
@papandreou papandreou deleted the feature/absorbUnexpectedSet branch April 26, 2022 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants