Closed TomerFi closed 1 year ago
@TomerFi There's no such support at the moment. However, you can just expect/assert b
separately by taking it out of the main object.
const { b } = {a: 'aa', b: { a: 'hey', c: 'dd' }, c: 'dd1'};
expect(b).excluding(c).to.deep.equal(b);
Hope it solves your issue.
Relates to #40
Yes, thanks. For the record, this should be coupled with another statement because I need to assert for the outer keys as well, so this should be something like:
const res = {a: 'aa', b: { a: 'hey', c: 'dd' }, c: 'dd1'};
expect(res).excluding('b').to.deep.equal({a: 'aa', c: 'dd1'});
expect(res.b).excluding('c').to.deep.equal({ a: 'hey' });
Thanks @mesaugat this is a really useful plugin, I'll watch #40. Unless you want to keep it open for tracking, feel free to close this issue.
@TomerFi Yes, you are correct. I left out the outer keys in hopes that you would understand.
Closing the issue.
Hello
Cool project, thank you very much for sharing! Is there a way for excluding a specific nested key? not every key.
Instead of this:
Something like this: