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

Commented Unassigned: Coverage + QUnit + Require.js results in timeout [246]

$
0
0

I've been able to setup QUnit testing and coverage using Chutzpah without require.js and everything works fine from both the Visual Studio extensions as well as the console runner.

Next, I added require.js into the mix. The tests work fine from both Visual Studio extensions and the console runner. Coverage, however, does not. It always results in a timeout.

I am *not* using a custom harness template.

I was able to put together a sample project that illustrates the issue. If you open the attached VS solution you'll see that the test run works fine, but coverage does not. I've done a bit of debugging by capturing the Chutzpah HTML harness that is output and running it in my browser. In the console I can see that the wrong URL is being used to load the test file.

I left the generated harness in the ZIP file (as _Chutzpah.fee23f2ac30325a47f946e34b7df81eb.test.html) so it can be examined. Basically it is trying to load a URL that has repeated "/Tests/" in the path:

<Root>/WebApplication3/Tests/Tests/Modules/ExampleTests.js

instead of what it should actually be loading:

<Root>/WebApplication3/Tests/Modules/ExampleTests.js

Perhaps the require.js options are modified differently by Chutzpah during a coverage test?
Comments: I believe I have seen this issue before and was looking into it but didn't figure it out. There is some issue with Blanket.js not liking the use of a custom base url with RequireJs and chutzpah. I will use your sample to take another investigation into it.

Viewing all articles
Browse latest Browse all 1864

Trending Articles



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