Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-3307

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

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

      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@mongodb.com Durran Jordan
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: