Is it possible to combine multiple conditions inside an expect in React Testing Library?
Asked Answered
Y

0

6

For example, there are two expect conditions like these:

expect(firstItem).toHaveClass(firstStyle);
expect(firstItem).not.toHaveClass(secondStyle);

Is there a way to make them in one line? Something like:

expect(firstItem).toHaveClass(firstStyle).and.not.toHaveClass(secondStyle);
Yardstick answered 28/6, 2022 at 15:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.