jest.mock("./MyService"); class MyService{ async f1(args) { let out= await this.f2(args); ... } } ... // my test code: MyService.f1.mockResolvedValueOnce([]); await OtherService.f3(); // f1 is mocked and called in f3 and returns [] (everything is fine) MyService.f1.mockRestore(); // trying to forget mocking f1 and getting the original behavior MyService.f2.mockResolvedValueOnce([some data]); // I want original f1 to be called and mock the inner f2 but f1 is never called and I get undefined output from itEstoy tratando de burlarme de las funciones de MyService solo ocasionalmente y después de usar la versión simulada, olvídese de esa burla y obtenga el comportamiento original de ellos. Pero cuando lo hago por una vez y restauro ese simulacro, me quedo sin definir para la salida de la función simulada y en realidad nunca se llama.