Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-100146

Add an option to pass JSON attributes to assert functions

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • Fully Compatible
    • QE 2025-02-17
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Even though SERVER-96944 introduces JSON output format to assert functions, however, many assert invocations add objects to the message, e.g.:

      assert.eq(1, docs.length, "unexpected number of documents : " + tojson(docs));
      

      This would serialize 'docs' into a string, which is undesirable. A better alternative:

      assert.eq(1, docs.length, "unexpected number of documents", {docs});
      

            Assignee:
            daniel.tabacaru@mongodb.com Daniel Tabacaru
            Reporter:
            romans.kasperovics@mongodb.com Romans Kasperovics
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None
              None
              None