Tox
0
Q:

expect any function jest

expect(parseTime('12:54')).toEqual(expect.objectContaining({ hours: 12, minutes: 54}))
1
# 1. Use '.toContain' when you want to check that an item is in an array.
# 2 '.toContain' can also check whether a string is a substring of another string.
test('the flavor list contains lime', () => {
  expect(['lime', 'mangle']).toContain('lime');
});

test('the flavor list contains lime', () => {
  expect("lime juice").toContain('lime');
});
0
expect(something).toEqual(expect.any(Function))
0

New to Communities?

Join the community