1

How can I test with jest a pnp function? How can I mock the webpart context and pnp responses?

I'm using spfx webpart, pnp-js-core and jest for unit testing

Thanks.

1 Answer 1

1

The SharePoint Framework React Jest Testing sample from GitHub for your reference.

SharePoint Framework React Jest Testing sample

Reference: SharePoint Framework unit-tests with Jest

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.