Asserts a string contains one or more substrings.
expect('Hello beautiful world!', 'to contain', 'beautiful');
expect('Hello beautiful world!', 'to contain', 'Hello', 'world');
In case of a failing expectation you get the following output:
expect('Hello world!', 'to contain', 'beautiful');
expected 'Hello world!' to contain 'beautiful'
This assertion can be negated using the not
flag:
expect('Hello world!', 'not to contain', 'beautiful', 'ugly');
In case of a failing expectation you get the following output:
expect('Hello beautiful world!', 'not to contain', 'beautiful', 'ugly');
expected 'Hello beautiful world!' not to contain 'beautiful', 'ugly'
Hello beautiful world!