Uploaded image for project: 'Moodle Community Sites'
  1. Moodle Community Sites
  2. MDLSITE-5960

Ban use of resetAfterTest in shared setup

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Low Low
    • Coding style
    • None

      This leads to the authorship of test files where it is not possible to write tests which do not reset after test.

      The call to resetAfterTest should be made immediately before data is inserted for the first time in either:

      • a test function
      • a helper

      It is possible to call resetAfterTest multiple times within a single test, so this is fine.

      Generally shared setUp should not create things which must be tidied. We should be careful of how we use it. See MDL-55609 for one example where we saved 10% of the total time required by refactoring tests to be better organised.

            Unassigned Unassigned
            dobedobedoh Andrew Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.