console.error to throw an error instead of printing it into the console.
It is useful in
Ivy enabled mode, because some errors are printed via
console instead of being thrown.
ngMocks.throwOnConsole stubs the functions for the current test suite in
beforeAll and restores in
Also, any other methods can be stubbed: