MCPcopy Create free account
hub / github.com/DTStack/molecule / expectLoggerErrorToBeCalled

Function expectLoggerErrorToBeCalled

test/utils.ts:8–16  ·  view source on GitHub ↗
(action: () => void)

Source from the content-addressed store, hash-verified

6 * Expect the `logger.error` method to be called when exec action
7 */
8export function expectLoggerErrorToBeCalled(action: () => void) {
9 const originalLog = logger.error;
10 logger.error = jest.fn();
11
12 action();
13 expect(logger.error).toBeCalled();
14
15 logger.error = originalLog;
16}
17
18/**
19 * Expect the `testFn` function to be called when exec action

Calls

no outgoing calls

Tested by

no test coverage detected