QUnit browser window vs. unit test sessions

Hi!

I've been trying out QUnit with Resharper, and I really like it. Looking forward to using it productively.
Had a few hiccups though, hope someone can help me with them.

First of all, is it possible to _not_ open a browser tab for each run?

Secondly, will the layout/stylesheet be properly loaded in IE some time? Just gets plain old colorless Times New Roman result now.

And third and hardest, the unit test session testlist randomly aborts x of y tests after a couple of runs, even though they run fine in the browser.

Lars-Erik

5 comments

Hi Lars-Erik,

thanks for your feedback! Regarding your questions:
1. Definitely we are aware of this problem and investigating and implementing other ways to do it. You could track issue progress: http://youtrack.jetbrains.net/issue/RSRP-232957
2. This is always hard with IE, you know :) But we're using standard QUnit layout, without any modifications. Could you please try running your tests with QUnit itself? And share screenshots and IE version info, please. I'll try to reproduce it.
3. How many tests do you have in session? Does this happen to last tests? Does it prevent running any other tests?

0

Hi again. :)

2. It actually seems like the virtual server that is created either don't server .css, or is terminated before IE (9) gets to do the .css request. When looking around with the F12 developer tool, I can see scripts are loaded, but no css.

3. See attached screenshot reproduced with the following code. I provoked it a bit by clicking run all tests a few times rather quick, but with a larger set of tests and regular intervals it starts happening more and more. All tests passed in browser though.

(guess which kata ;) )

/// 20110706 CalculatorTests.js
/// <reference path="20110706 Calculator.js"/>
module("20110706 Calculator tests");
test("Empty string returns zero", function() {
assertAdd(0, "");
});
test("One returns one", function() {
assertAdd(1, "1");
});
test("Two returns two", function() {
assertAdd(2, "2");
});
test("One and two returns three", function() {
assertAdd(3, "1,2");
});
test("One, two and three returns six", function() {
assertAdd(6, "1,2,3");
});
test("Can split by linefeed", function() {
assertAdd(6, "1,2\n3");
});
function assertAdd(expectedResult, inputString) {
var sum = Calculator.add(inputString);
equals(expectedResult, sum, "\"" + inputString + "\" should yield " + expectedResult);
}

/// 20110706 Calculator.js
var Calculator = function() {
var standardDelimiters = /,|\n/g;
function getNumbers(input) {
return input.toString().split(standardDelimiters);
}
function addNumbers(numbers) {
var sum = 0;
for (var i = 0; i < numbers.length; i++)
sum += new Number(numbers[i]);
return sum;
}
function add(input) {
var numbers = getNumbers(input);
return addNumbers(numbers);
}

return {
add: add
};
} ();



Attachment(s):
utsabort.png
0

Should I add a bug on the tracker for the IE related problem described in previous post?

0

Yes, please, it will be easier to track status and you will the first notified when this bug is fixed.

0

Please sign in to leave a comment.