How to assert that all objects inside array do not include multiple properties. Example all of them should not include keys "email" and "phone".
const myArray = [
{name: "John Doe", email: "john@gmail.com", phone: "9xxxxxxxxxx"},
{name: "Jane Doe", email: "jane@gmail.com", phone: "9xxxxxxxxxx"},
{name: "Johny Doe"}
]
// this seems to do what I want
// but doesn't "something" check if any object passes the test?
expect(myArray).to.contain.something.that.does.not.include.any.keys("email", "phone")
Using chai-things
.
Aucun commentaire:
Enregistrer un commentaire