ts-auto-mock requires a common context between tests when you are using custom methods implementations
if you want to see the full code example go to examples/karma-webpack
const webpackConfig = require('./webpack.test.js');
module.exports = function(config) {
const _config = {
...
files: [
{
pattern: "./entryFile.ts", // see below
watched: false
}
],
preprocessors: {
"../entryFile.ts" : // see below ['webpack']
},
...
};
config.set(_config);
};//entryFile.ts
import "jasmine-ts-auto-mock";
const context = require.context('', true, /\.test\.ts$/);
context.keys().map(context);