Quantcast
Channel: Chutzpah - A JavaScript Test Runner
Viewing all articles
Browse latest Browse all 1864

Commented Unassigned: Load html fixtures [133]

$
0
0
Hi!

Via reference I am able to load .js files, and all is good.

However, I would also like to load html fixtures using jasmine-jquerys loadFixture() (or readFixture)

If i try to reference the html file chutzpah tries to load it in as a .js file (<script src=test.html>)

I've seen some examples of people using it, but I've not been able to do it myself.

Is it possible to load html fixtures?
Comments: I've been trying the same in the last few days and this is what I came up with: Testing with QUnit, I write my tests in a tests.js file, without an .html test harness, and then use JQuery to load into a div the content of a file placed in the same folder as tests.js. The results are: - it works if I run the tests from the console: the html gets loaded into the div and I can manipulate it and test the results; - if I run the tests from Visual Studio by clicking on the test bullet beside each test function, the tests (all of them) will run in my default browser but the html won't be loaded; - if I run the tests from Visual Studio's context menu, right clicking on the tests folder or on the tests.js file, no test is run - the console will tell me 0 test run, 0 passed and 0 failed. In the first case, the html has to be stored in a file with an extension different from .htm or .html as otherwise Chutzpah will try to load that file as well as a test file. I don't know how much I'm doing wrong and how much is just inconsistent behaviour from Chutzpah. At the moment I'll start my tests from console, it's enough though not as nice as it could have been...

Viewing all articles
Browse latest Browse all 1864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>