-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expect holds reference to value, generates error string at the end of test (after mutation) #429
Comments
This might be a problem in Jasmine itself. Perhaps when/if we upgrade to a newer version of that this will just work. |
@cpojer, In #434 as a reason for closing the issue, you said:
I don't think you need to clone, just generate the string representation at |
Fixed in the next release. |
Summary:related to #429 It can be an expensive operation, but it only occurs when a test fails. the following test: ```js it('keeps the reference', function() { var a = [1]; expect(a).toEqual([1, 2]); a.push(2); }); ``` before: ![screen shot 2016-04-12 at 5 55 40 pm](https://cloud.githubusercontent.com/assets/940133/14479858/ded42e0e-00d7-11e6-8841-0d817ca02d45.png) after: ![screen shot 2016-04-12 at 5 56 03 pm](https://cloud.githubusercontent.com/assets/940133/14479860/e3d1710a-00d7-11e6-837f-e2f2bdfb27b7.png) Closes #889 Differential Revision: D3188934 fb-gh-sync-id: 02e8b2e3466d7994a1d3e5e428b80ddd0f455fe5 fbshipit-source-id: 02e8b2e3466d7994a1d3e5e428b80ddd0f455fe5
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
expect
should print the expected value as[1]
but prints as[]
.The text was updated successfully, but these errors were encountered: