Hi ! :)
I would to test if an object if one of entries from an array containing objects.
It's something like: expect({}).to.deep.oneOf([{}, {}, {}])
But I got this error: AssertionError: expected { Object (type, sender, ...) } to be one of [ Array(3) ]
With more details, this is the test with the object and the array:
expect({
"type": "text",
"sender": "bot",
"user": "USER_TEST",
"payload": {
"value": "Lorem ipsum"
}
}).to.deep.oneOf([
{
"type": "text",
"sender": "bot",
"user": "USER_TEST",
"payload": {
"value": "Dolor sit amet"
}
},
{
"type": "text",
"sender": "bot",
"user": "USER_TEST",
"payload": {
"value": "Lorem ipsum"
}
},
{
"type": "text",
"sender": "bot",
"user": "USER_TEST",
"payload": {
"value": "Consectetur adipiscing elit"
}
}
])
How can I do this kind of test ?
Hi ! :)
I would to test if an object if one of entries from an array containing objects.
It's something like:
expect({}).to.deep.oneOf([{}, {}, {}])But I got this error:
AssertionError: expected { Object (type, sender, ...) } to be one of [ Array(3) ]With more details, this is the test with the object and the array:
How can I do this kind of test ?