jessewmc
jessewmc

Reputation: 1164

karma-html2js does not create window.__html__

So I have verified window.__karma__.files contains my .html files (karma files config is picking them up). If I have html2js disabled, files show up as file.html in window.__karma__.files. If I enable html2js, files show up as file.html.js in window.__karma__.files. Either way, window.__html__ is undefined.

Also using karma-jasmine and karma-requirejs, attempting to use karma-fixture but this is a show stopper for that.

I am not using angular, and I am not using ng-html2js. I have log_debug enabled in my karma config, and the preprocessor is reporting "Processing" for all of my .html files.

I'm at a total loss here. Anyone seen this before?

Upvotes: 1

Views: 569

Answers (1)

jessewmc
jessewmc

Reputation: 1164

Turns out the issue is in karma.conf.

files: [ ..., {pattern: '**/*.html', included: false}, ... ]

Does not work. I copied my pattern from my js files that are not included (because I load them via requirejs), and left included set to false there. Apparently included should be true (default) or the js-ified file (with the window.__html__ = ... code at the top) is never executed.

Upvotes: 2

Related Questions