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

Add assert.doesNotThrow() javascript shell function

    XMLWordPrintableJSON

Details

    Description

      Analogue to assert.throws. Should be used to self-document when the expected failure mode for a test case is for an exception to be thrown. Will output a stack trace through doassert (note that output generated for uncaught exceptions currently does not even include a line number).

      assert.doesNotThrow = function(func, params, msg) { ... };
      assert.doesNotThrow.automsg = function(func, params) { ... };

      Example usage:

      assert.doesNotThrow(function() { db.foo.find({a:{$gt:0}}).itcount(); },
                          [],
                          "testing that the $gt operator is recognized");

      Attachments

        Activity

          People

            rassi J Rassi
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: