String diffing for assert.eq reverses arguments

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • DevProd Test Infrastructure
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The description for assert.eq shows the suggested usage as

       

       * @example
       * const actual = getValue();  
       * const expected = 'foobar';  
       * assert.eq(actual, expected);  

      but then the colored diff treats the first argument as "expected" and the second as "actual"

      assert.eq = function (a, b, msg, attr) { 
      ...
          const aDisplay = shortDisp(a);
          const bDisplay = shortDisp(b);
          const diff = patchDiff(a, b);
      
          _doassert(msg, `expected ${aDisplay} to equal ${bDisplay}\n${diff}\n`, {...attr});

       

            Assignee:
            Steve McClure
            Reporter:
            Alberto Massari
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: