Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
simulacro predeterminado para broma después de jest.resetAllMocks()

Este es mi simulacro predeterminado.

 const mockFetcher = jest.fn().mockImplementation(() => { return { get: jest .fn() .mockImplementation(() => Promise.resolve({ data: 'testData' })), post: jest .fn() .mockImplementation(() => Promise.resolve({ data: 'testData' })), }; });

A veces, quiero devolver un valor diferente, pero después quiero restablecer mi simulación al estado predeterminado. Yo uso el método jest.resetAllMock() . Mi problema es que reset le da un valor de jest.fn() solamente. Y no un valor de una función que contiene funciones de configuración.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!