jest.restoreAllMocks()jest.restoreAllMocks() puts the real console.error back, because it restores spied methods to their originals. The tempting resetAllMocks is wrong. It removes mock implementations, but the method is still a mock. clearAllMocks only resets recorded calls and results. resetModules clears the module registry, Jest's cache of loaded modules. It has nothing to do with spies.