Something I find myself doing occasionally is checking multiple assertions in a test. Would it be a good idea to support syntax like the following? Maybe this would mean you can have sub-parts succeed and others fail? The advantage here is you can print the values in scope once instead of having separate tests. If it crashes they all fail together etc.
Note there are currently ways to achieve similar results which I have inlcluded below.
expect
result = { first : 1, second : 2, third : 3, fourth : 4}
result.first == 1
result.second == 2
result.third == 3
result.fourth == 4
Alternative 1. Use a big logical && statement. Downside, is its a bit messy and hard to know which assertion failed.
expect
result = { first : 1, second : 2, third : 3, fourth : 4}
result.first == 1 && result.second == 2 && result.third == 3 && result.fourth == 4
Alternative 2. Break into separate tests. Downside, doesn't print values when the assertions fail.
testData1 = { first : 1, second : 2, third : 3, fourth : 4}
expect testData1.first == 1
expect testData1.second == 2
expect testData1.third == 3
expect testData1.fourth == 4
I like it, it's a lot cleaner than the alternatives. Perhaps we should call this version expectAll?
one of my goals with expect is to minimize the number of things you have to learn to use it effectively, because I think the less friction that's involved in writing tests, the more tests will get written
so I'd like to start from the perspective of "how can we improve the current design without introducing anything new to learn?"
in this case it seems like the answer would be having the two snippets above print out more intermediate values, yeah?
That would be a better experience for sure, I could still see expectAll being worth the trade-off but I'm not 100% convinced of that either. I would expect that in practice you'd regularly have files with a large amount of expect (something a) == b in a row where it would be nicer to have a cleaner expectAll.
Last updated: Jun 16 2026 at 16:19 UTC