Refactoring tests that were dumping errors to the console