-
Notifications
You must be signed in to change notification settings - Fork 82
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
Chai .to.have.all.keys()
conversion fails
#60
Comments
Thanks for reporting this. : ) Do you want to work on a PR for this? |
Yes I would like to give it a try 😉 |
Sound good. Let me know if you need any help. : ) |
src/transformers/chai-should.js:406 I already added tests in my fork: WebDevMichael@39dbb22 |
It sounds right to me. |
How can I see if the Identifier (constant JSON object) is of the type |
So that is the challenging part. Short answer: you can't. Longer answer: if the identifier is assigned inside the file you can search the AST for assignment to this specific identifier... But it might be assigned multiple places. AND the identifier might be defined in another file. I cases like this, I do a best guess and log a warning that the transformation might not be right. |
In Chai when we want to assert that a JSON object has specific keys we can use
.to.have.all.keys()
. As you can see in the code below, the output is incorrect and the current output compares the complete JSON object toexpect.arrayContaining()
The text was updated successfully, but these errors were encountered: