Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-474

Chore: ensure async-writer tests have explicit fails when trying to check for errors

    XMLWordPrintableJSON

Details

    • Not Needed

    Description

      Problem Description

      A lot of tests in the async-writer check for errors being thrown in unsupported situations. These tests all follow the same pattern:

      try {
        operationThatShouldThrow(...);
      {{ } catch (e) {}}
      {{   expect(e.name).to.equal(...);}}
      {{   ...}}
      {{ }}}

      However, if the operationThatShouldThrow does not throw, the test will still pass.

      Solution

      After operationThatShouldThrow there should always be an explicit fail() call to ensure the tests fails if no error is thrown.

      Attachments

        Activity

          People

            Unassigned Unassigned
            michael.rose@mongodb.com Michael Rose (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: