When using karma-webpack and istanbul-instrumenter-loader or isparta-loader, I get an error when attempting to implement it.
require.context comes up as undefined.
I believe this is because it is using/finding nodejs require and NOT webpack, as Object.keys(require) logs as ['keys', 'resolve', 'id'].
It looks like
require.contextis working, butrequirealone would usenode. This may have something to do with the way that webpack doesn’t always treat object syntax as an actual object.Therefore
requirehas nothing to do withrequire.context. It is likely a regex function replace during build-time.