Expand testing with negation and error handling #458
Labels
discussion
stdlib
Standard library related
tooling
Tooling related feature (formatter, documentation, production builder)
Raised from trying to add tests for #453. I need to check a
!= 0
or> 0
, which does not seem to be available in the testing framework. Since it's written in JavaScript and fails based on exceptions, I have tried to think of the least impactful change to get negation if the expectation is to keep the testing framework using inline JavaScript and not Mint.I could add an
assertNotEqual
or anassertNotTextOf
(which is a weird name), but it seems like adding negation like other test frameworks do would be a better result.The trouble with this is that not finding a selector is not the same as the test passing. This could be handled with custom
Error
types, rather than catching any exception. You could leave the regular exception errors for test implementation failures, and then raise anAssertionFailure
(or something) that gets handled differently when caught. For example, is assertTextOf with only a change to throw anAssertionFailure
.The text was updated successfully, but these errors were encountered: