Uploaded image for project: 'Fluid Infusion'
  1. Fluid Infusion
  2. FLUID-5749

jqUnit's "assertEquals" method should be bound to QUnit's "strictEqual" and not "equal"

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.0
    • 1.9
    • Testing Infrastructure
    • 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.

      Attachments

        Activity

          People

            antranig Antranig Basman
            antranig Antranig Basman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: