Answers for "jest matcher isarray"

1

jest check array of string

const fruits = ['apple', 'cat'];

test('should have array of string', () => {
  expect(fruits).toEqual(
    expect.arrayContaining([expect.any(String)])
  );
});
Posted by: Guest on April-06-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language