Skip to content

Absorb the unexpected-set plugin - #783

Merged
papandreou merged 5 commits into
masterfrom
feature/absorbUnexpectedSet
Apr 26, 2022
Merged

Absorb the unexpected-set plugin#783
papandreou merged 5 commits into
masterfrom
feature/absorbUnexpectedSet

Conversation

@papandreou

@papandreou papandreou commented Dec 20, 2020

Copy link
Copy Markdown
Member

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

sunesimonsen commented Dec 20, 2020

Copy link
Copy Markdown
Member

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