Slide 46
Slide 46 text
test('list three fruits', () => {
const expectedFruits = ['banana', 'mango', 'watermelon']
expect(expectedFruits[0]).toEqual('banana')
expect(expectedFruits[1]).toEqual('mango')
expect(expectedFruits[2]).toEqual('watermelon')
})
test('list three fruits', () => {
const expectedFruits = ['banana', 'mango', 'watermelon']
const actualFruits = ['banana', 'mango', 'watermelon']
expect(expectedFruits).toEqual(
expect.arrayContaining(actualFruits)
)
})
Arrays
🧱