jest match check array element code example
Example: jest check array of string
const fruits = ['apple', 'cat'];
test('should have array of string', () => {
expect(fruits).toEqual(
expect.arrayContaining([expect.any(String)])
);
});
const fruits = ['apple', 'cat'];
test('should have array of string', () => {
expect(fruits).toEqual(
expect.arrayContaining([expect.any(String)])
);
});