Apply replacement of the original registry also for custom mocks

I noticed that issue when I was running the tests, with my npm
cache cleaned and no network connection.