1const users = [{id: 1, name: 'Hugo'}, {id: 2, name: 'Francesco'}];
2
3test('we should have ids 1 and 2', () => {
4 expect(users).toEqual(
5 expect.arrayContaining([
6 expect.objectContaining({id: 1}),
7 expect.objectContaining({id: 2})
8 ])
9 );
10});
1test('id should match', () => {
2 const obj = {
3 id: '111',
4 productName: 'Jest Handbook',
5 url: 'https://jesthandbook.com'
6 };
7 expect(obj.id).toEqual('111');
8});
9