Details
-
Bug
-
Resolution: Fixed
-
Major
-
1.9
-
None
Description
jqUnit's "assertEquals" and "assertNotEquals" are bound to QUnit's "equal" and "notEqual" which use the JavaScript == and !== operators for comparison. This is against our best practices and is quite unexpected to the test author. Recently I found a passing test which included the following:
prefsEditor.saveCalled = false;
prefsEditor.applier.change("", bwSkin);
jqUnit.assertEquals("Model has changed, auto-save changes", 1, prefsEditor.saveCalled);
which was clearly operating under the assumption that "saveCalled" was a boolean, and passing due to sloppy coercion allowing 1 == true. We should fix up jqUnit and all of our tests to ensure that === is used throughout.