News for hackers. Stuff that matters.
Re:My favourite Git commit (2019) by jfkebwjsbx on Sunday March 08, 2020 @03:53PM (#22520139)
What do you mean by matcher?
Re:My favourite Git commit (2019) by allover on Sunday March 08, 2020 @04:07PM (#22520241)
> "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.

Re:My favourite Git commit (2019) by jfkebwjsbx on Sunday March 08, 2020 @04:50PM (#22520521)
Ah, the common testing functions like `assert_equal`. Thanks!
Re:My favourite Git commit (2019) by hinkley on Monday March 09, 2020 @01:23PM (#22527320)
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.