-
-
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
Object.create always returns {} #695
Comments
can you (I'm closing this because it is likely not an issue with jest and more like a question, but happy to reopen if it turns out to be one :) ) |
This is a peculiarity of console.log, but it works correctly. Object.create attaches the object you provide as the prototype. And console.log doesn't log the prototype, only the own_properties of the object. See:
|
@Sebmaster thanks for the explanation! I don't normally pass anything other than null to Object.create. |
Yes, I confirmed, great thanks for your answer. On Thu, Jan 28, 2016 at 11:21 AM, Sebastian Mayr notifications@github.com
|
## Summary Building on #6950, this adds an e2e test and the requested circus fix. fixes #6947 closes #695 To Do: - [x] make sure new tests pass - [x] clean up circus fix with proper error information - [x] update CHANGELOG.md ## Test plan The e2e test is failing and I'm having trouble figuring out why, so I'd like to see if it fails on CI too.
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. |
No matter what is passed into Object.create as its first parameter, it just returns {}, I am not sure if this is designed in purpose, if yes, I wonder if there is a reason and if there is a workaround. Here is a simple example of test case for this
The running result of the code above may look like this:
Obviously I am expecting it to return { a: 1, b: 2} instead of {}
I would like to appreciate your effort for examining this issue.
The text was updated successfully, but these errors were encountered: