Currently, you can error when one of three console methods are called: log, warn, and error. For libraries that are using console.assert to do validation (such as I'm using for parameter validation in this project ), a failed console assertion is an indication of a problem of some kind. Here, I add a new method stub to console to intercept calls to assert, and fail the test only if the assertion fails. This is behind a parameter which defaults to false, so upgrading clients shouldn't be disrupted, and we shouldn't have to bump the major version.
Currently, you can error when one of three console methods are called: log, warn, and error. For libraries that are using
console.assert
to do validation (such as I'm using for parameter validation in this project ), a failed console assertion is an indication of a problem of some kind. Here, I add a new method stub to console to intercept calls to assert, and fail the test only if the assertion fails. This is behind a parameter which defaults to false, so upgrading clients shouldn't be disrupted, and we shouldn't have to bump the major version.