Reputation: 8240
I have a test like:
const myText = 'This is my test';
expect(myText, contains('This'));
expect(myText, contains('test'));
How can I combine those 2 matchers to have only 1 expect
?
Upvotes: 2
Views: 82
Reputation: 8240
You can combine the matchers with allOf
:
const myText = 'This is my test';
expect(myText, allOf([contains('This'), contains('test')]));
More generally, you can combine any matchers using:
Upvotes: 4