Skip to main content
Version: 7.5.5

Expect

How to use the expect method to assert:

const inputValue = `hello world`;

await I.expect(inputValue).toEqual(`hello world`);

The above is really a simple form of assertion, and it should pass, because the input value equals the value with expect in the toEqual Assertion.

Now what would happen if we pass a wrong value?

const inputValue = `hella mold`;

await I.expect(inputValue).toEqual(`hello world`);

​ The test will fail, because obviously, hella mold does not equal hello world. You should see something similar to the image below as the Error Details:

Assert fail Example

Test Maker have a powerful reporting system, and if you look carefully at the image above you would see that Test Maker is giving you lots of information on why that Assertion failed.

On top of that Test Maker Assertion API has a Diffing system, which gives the difference between the received and expected value.