I've started using QUnit for testing the jQuery code of a certain page in my ASP.NET MVC3 application. So far I've provided a HTML-mock which the javascript-file under test uses. Is it possible to have it referencing the actual HTML for the page used by the application instead?
From what I can see you are trying to pre-render the HTML from the server, and run your unit-tests off of that. I dont beleive that is a great way to do this, and run your JS on that in correct sequence. Your best bet is to create a standard HTML page (not a view page), save it in your scripts folder, and use that as your "test" page. You should not rely on any standard HTML to run your Unit Tests, for the dom can be altered at any time, instead, in your unit tests handle all dom manipulation then run your assert, then remove it if it passes to maximize efficiency. You should be able to create a test environment on the dom, test it, then whipe it, rinse and repeat.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With