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

[Feature Request] add property matchers #194

Open
andykais opened this issue Dec 29, 2018 · 1 comment
Open

[Feature Request] add property matchers #194

andykais opened this issue Dec 29, 2018 · 1 comment

Comments

@andykais
Copy link

It would be awesome to see property matchers like those in jest's snapshot testing. In short, they allow you to specify certain fields to ignore in JSON snapshots

e.g. (using jest's snapshots)

const obj = {
  id: dynamic(),
  foo: 'bar',
  other: 'value',
  val: 1,
};
expect(obj).toMatchSnapshot({
  id: expect.any(String),
});

linked here is jest's documentation of this feature: https://jestjs.io/docs/en/snapshot-testing#property-matchers

@kuceb
Copy link

kuceb commented May 7, 2019

This could be done if the compare function also can change the what, so you could just bring your own compare function that implements property matchers

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

No branches or pull requests

2 participants