I am trying to create a unit test with Jest to make sure my array called values does not contain falsy values.
This for some reason does not work - the test passes:
const badValues = ['', null, undefined, false, {}, []];
expect(values).toEqual(expect.not.arrayContaining(badValues));
Below code works as expected (test fails), but surely there must be a proper way instead of looping over my values?
for (const value of values) {
expect(value).toBeTruthy();
}