Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What do you mean by matcher?


> "matchers" [...] let you test values in different ways

Example docs for Jest's matchers: https://jestjs.io/docs/en/using-matchers

Generally speaking, if you use a specific matcher, you get a better (more informative) error message when the test fails.


Ah, the common testing functions like `assert_equal`. Thanks!


Right, and some APIs let you write your own. Getting a custom one to hand out actionable error messages is a bit tricky but quite worth it.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: