Skip to content
Advertisement

TypeError: nock(…).persist(…).log is not a function

I am trying to get more info on why my nock mock is not right, but I can’t make the persist().log() work.

Here is the test :

JavaScript

Stackoverflow wants me to add some more details to be able to post this question, but I don’t know what to tell you more than that.

Advertisement

Answer

.log was removed in Nock v13 because it didn’t provide much info when debugging. https://github.com/nock/nock/blob/main/migration_guides/migrating_to_13.md#breaking-changes

Instead, you want to use DEBUG get more info on why a particular request is not being matched. https://github.com/nock/nock#debugging

Do something like:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement