connectapi
connectapi copied to clipboard
test: Don't expect_error() without asserting the message
I fixed one issue recently where there was a syntax error in the error message construction, so instead of showing the expected message, it was showing a string interpolation error. But the test we had for that case was just doing expect_error(), so it was passing. We should generally assert something about the error message so that we know the expected error is happening.
The only examples of this I could find were:
https://github.com/rstudio/connectapi/blob/b98e430c101c59b72b5f5a988906f4146612f535/tests/testthat/test-content.R#L12-L20
Gonna fix those in January. There are also some terse assertions of substrings, but those should be fine.