I'm attempting to use Elio and Velin's guidance on creating unit tests for the SharePoint framework. Both appear to work great for vanilla components, but I'm running into problems when trying to incorporate an external dependency.
Here is the error I get when trying to run a HelloWorld-type test on my SPFx web part.
This is the dependency it's complaining about, located in my config.json file.
Here is the relevant piece of my package.json. (It did not format well when I tried to post it all as code.)
And here are some npm warnings I'm getting in the console. (I think they might be related to my problem.)
Full disclosure: I'm a SharePoint dev learning the SPFx, and newbie to webpack, npm, and nodejs. From Googling, I found the following GitHub issues which indicate the problem might be webpack related?
- https://github.com/webpack-contrib/karma-webpack/issues/125
- https://github.com/airbnb/enzyme/issues/47
Thanks! :-)