Considering an array [1, 1, 1] how can I validate that all elements matches 1 using chai.js?
Is there something like expect(array).to.only.contain(1);?
Considering an array [1, 1, 1] how can I validate that all elements matches 1 using chai.js?
Is there something like expect(array).to.only.contain(1);?
One way I do it for elements in array is to go through each element and check that value:
array.forEach(el => expect(el).toBe(1));