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

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 2.0
    • Component/s: Testing Infrastructure
    • Labels:
      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

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

              Dates

              Created:
              Updated:
              Resolved: