This repository was archived by the owner on Feb 15, 2025. It is now read-only.

Description
I was trying to configure nwb with karma-html2js-preprocessor with the following configuration:
module.exports = {
type: 'web-module',
npm: {
esModules: true,
umd: false
},
karma: {
preprocessors: {
'tests/data/**/*.html': ['html2js']
},
testFiles: [
'tests/data/**/*.html'
],
html2JsPreprocessor: {
stripPrefix: 'tests/data/',
processPath: function(filePath) {
return filePath.replace(/\.html$/, '');
}
}
}
}
Seemingly, the both the preprocessors and the html2JsPreprocessor are completely ignored. As I can see, the getKarmaPluginConfig() has only hardwired preprocessors config:
var preprocessors = {};
if (userKarma.testContext) {
files.push(userKarma.testContext);
preprocessors[userKarma.testContext] = ['webpack', 'sourcemap'];
} else {
testFiles.forEach(function (testGlob) {
files.push(testGlob);
preprocessors[testGlob] = ['webpack', 'sourcemap'];
});
}
I understand that nwb karma config is not the same as the raw karma config because it's being transformed. Do you guys have a workaround for this? Am I missing something? Is there any way to configure nwb karma with 3rd party pre-processors?