You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While updating our reporter test code, it has been discovered that many tests are restoring aspects of the tested objects due to use of shallow cloning. Typically, the test code makes a copy of the affected object, mutates it temporarily, then restores it. Problem is that making a copy via assignment of an object does not work protect its properties, and those "twiddled" properties are still present in the original when restored. We need a "deep clone" method, and then to apply it to all reporter specs.
While not evaluated elsewhere (yet), it is almost certain this problem is far more widespread.
Versions
Mocha 5.2 (past & future)
The text was updated successfully, but these errors were encountered:
Description
While updating our reporter test code, it has been discovered that many tests are restoring aspects of the tested objects due to use of shallow cloning. Typically, the test code makes a copy of the affected object, mutates it temporarily, then restores it. Problem is that making a copy via assignment of an object does not work protect its properties, and those "twiddled" properties are still present in the original when restored. We need a "deep clone" method, and then to apply it to all reporter specs.
While not evaluated elsewhere (yet), it is almost certain this problem is far more widespread.
Versions
Mocha 5.2 (past & future)
The text was updated successfully, but these errors were encountered: