SoniCoder
SoniCoder

Reputation: 4174

How can I load HTML fixtures for Javascript unit tests in Karma with Mocha?

Im searching for a decent test runner and unit testing framework for Javascript. My candidates are Karma and Mocha. Previously I used JsTestDriver, where adding HTML fixtures was easy, but I cant find a way how to load HTML fragments and access it from Mocha tests using Karma testrunner

Upvotes: 8

Views: 2406

Answers (2)

SoniCoder
SoniCoder

Reputation: 4174

The final solution was Karma testrunner combined with RequireJS, which has a text plugin making the loading of HTML fixtures really easy. A working example can be seen at this Minesweeper game. It's still in development phase, but the the libraries and structuring are working.

Upvotes: 2

Jason Weden
Jason Weden

Reputation: 516

I have a demo that uses html fixtures with jasmine here and the demo description contains links to a screencast and github repo for running with Karma. See this link.

Upvotes: 3

Related Questions