-
Type: Bug
-
Resolution: Gone away
-
Priority: Major - P3
-
Affects Version/s: 0.5.2
-
Component/s: AsyncWriter
-
None
-
Not Needed
Problem Description
There is a test case (https://github.com/mongodb-js/mongosh/blob/master/packages/async-rewriter/src/async-writer-babel.spec.ts#L2880) that should verify that an error is thrown if an assignment to a class member happens outside the constructor using the this keyword.
However, the test case passes - but no error is thrown. The test case is missing a fail() call after the compileCheckScopes.
Steps to Reproduce
Run the async-writer tests
Expected Results
The referenced test case passes because an error is thrown.
Actual Results
The referenced test cases passes since no error is thrown and an explicit fail is missing.
Additional Notes
The fix should probably be placed inside this if statement: https://github.com/mongodb-js/mongosh/blob/master/packages/async-rewriter/src/async-writer-babel.ts#L306. The check whether the assignment is inside a constructor is missing here.