mardi 12 avril 2016

Difference between unmock and dontMock in Jest

So I've been writing a successful unit test library and all seems well. And then I noticed in some online examples that where I do this:-

jest.unmock('../lib/q');

Others do this:-

jest.dontMock('../lib/q');

I can't find any documentation on the Jest site (the documentation isn't great let's be honest), so I changed one of my suites for a giggle to dontMock and quite a lot exploded ... What's the difference?

Aucun commentaire:

Enregistrer un commentaire