Closed Torniojaws closed 5 years ago
Perhaps something like .excludingEvery('data.created')?
@Torniojaws There's no way to do this currently. From what I see, you are doing it correctly by separating the assertions.
Also, @Torniojaws you can keep the created
key in your result and chai-exclude
will still ignore the key from comparison.
expect(res.body.data).excludingEvery('created').to.eql([
{ id: 1, value: "Hello", created: "2019-10-02 14:30:00" },
{ id: 2, value: "There", created: "2019-10-02 14:30:00" },
{ id: 3, value: "General", created: "2019-10-02 14:30:00" }
]);
Closing this issue @Torniojaws, I hope I have answered your question. If there are any updates in the future I'll reply back in this thread.
I'm not sure how the syntax should be for this case:
Input:
Assert:
I ended up separating the top level, but I was wondering if there is a way to exclude in a single assert? Perhaps something like
.excludingEvery('data.created')
?Separated: