vercel / next.js

The React Framework
https://nextjs.org
MIT License
121.29k stars 25.96k forks source link

Improve test assertions #65285

Closed eps1lon closed 2 weeks ago

eps1lon commented 2 weeks ago

Cherry-picked from https://github.com/vercel/next.js/pull/65058 where this test was originally failing.

Usually, you want to keep your value on the left side of the assertion as complete as possible so that the testing framework can display a rich diff in case the test fails. Comparing booleans would not provide a rich diff. For example, Array.prototype.some on the left side can become expect.arrayContaining() or String.prototype.includes can become expect.stringContaining.

Closes NEXT-3286

ijjk commented 2 weeks ago

Tests Passed