Unified test format: embedded documents that contain $$unsetOrMatches shouldn't assert identical keys

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 3.6.10
    • Affects Version/s: 3.6.9
    • Component/s: None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      When checking the expected results in the unified test runner for embedded documents, there is a case where the keys do not need to be identical. look in the depth > 1 if block. And use the below assertion.

       // Don't check for full key set equality because some of the actual keys
              // might be e.g. $$unsetOrMatches, which can be omitted.
              expect(
                actualKeys.filter(key => !expectedKeys.includes(key)),
                `[${Object.keys(actual)}] has more than the expected keys: [${Object.keys(expected)}]`
              ).to.have.lengthOf(0);
      

              Assignee:
              Durran Jordan
              Reporter:
              Neal Beeken
              Neal Beeken
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: