Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jest check array of string

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

test('should have array of string', () => {
  expect(fruits).toEqual(
    expect.arrayContaining([expect.any(String)])
  );
});
 
PREVIOUS NEXT
Tagged: #jest #check #array #string
ADD COMMENT
Topic
Name
1+5 =