I'm trying to write a unit test for an AngularJS directive using Karma. To be able to use the directive's template in the test I use karma-ng-html2js-preprocessor.
For the following template HTML I get a Lexer error message in the unit test, but in the real system everything works fine.
<div class="test"
ng-style="{width: vm.width,
height: vm.height,
'margin-left': vm.x,
'margin-top': vm.y}">
</div>
Error message:
Error: [$parse:lexerr] Lexer Error: Unexpected next character at columns 17-17 [] in expression [{width: vm.width,\n' + ' height: vm.height,\n' + ' \'margin-left\': vm.x,\n' + ' \'margin-top\': vm.y}].
Is this a bug in the preprocessor or is there a problem with my expression ?