Why is Karma refusing to serve my JSON fixture (which I'd like to use in my jasmine / angularjs tests)

后端 未结 3 1780
清酒与你
清酒与你 2021-01-06 09:40

As indicated in this stackoverflow answer, it looks like Karma will serve JSON fixtures. However, I\'ve spent too many hours trying to get it to work in my environment. Re

3条回答
  •  自闭症患者
    2021-01-06 09:41

    Your problem is that 'false' has to be a boolean, not a string.

    There is already an issue to validate the config better and fix such a mistakes.

    Also, you might write a simple "json" preprocessor (similar to karma-html2js) that would make it valid JS and put the JSON into some global namespace so that you can keep the tests synchronous...

提交回复
热议问题