in JavaScript

Mock HTML for qUnit test

Share on Facebook0Tweet about this on TwitterShare on LinkedIn0Share on Google+0Email this to someone

When you write tests in qUnit, you might come to a point where you need to mock some HTML for the test.
Qunit support this as simple as this:

In your HTML markup you got a div:

This div is the center for your tests, test markup will be in this div (hidden).

So in your test you can append html to this div and later on work with it:

Simple clean and easy to mock HTML with qUnit!

Share on Facebook0Tweet about this on TwitterShare on LinkedIn0Share on Google+0Email this to someone

Write a Comment

Comment