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

    • Not Needed

      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.

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

              Created:
              Updated:
              Resolved: