- Let's say we are implementing a Jest test and we have a variable called result, which we want to check isn't null. How can we do this with Jest matcher functions?
- Let's say we have a variable called person that is of type IPerson:
interface IPerson {
id: number;
name: string;
}
We want to check that the person variable is { id: 1, name: "bob" }. How can we do this with Jest matcher functions?
- Is it possible to carry out our check in the last question with a Jest snapshot test? If so, how?
- We have implemented a component called CheckList which renders text from an array in a list. Each list item has a checkbox so that the user can select list items. The component has a function prop called onItemSelect that is called when a user selects an item by checking the checkbox. We are implementing a test to verify that the onItemSelect prop works...