The assertion error for 'incude(object, propName)' is cryptic when 'propName' is a string
See original GitHub issueWhen you make a mistake and use assert.include
instead of assert.property
to assert that an object has a specific property (e.g. assert.include({ foo: 'bar' }, 'foo');
), the error message is very unclear:
> chai.assert.include({ foo: 'bar' }, 'foo')
AssertionError: object tested must be an array, a map, an object, a set, a string, or a weakset, but object given
Can we do something to indicate clearly that this combination of arguments (an object + a string) is not possible for assert.include
?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Junit Assertion Error - Getting error even though Expected ...
Well the return type is ArrayList<ArrayList<String>> and I am returning the same type from a method as well. I have added a code,...
Read more >AssertionError (Java Platform SE 7 )
Constructs an AssertionError with its detail message derived from the specified object, which is converted to a string as defined in section 15.18....
Read more >Assertions
Cypress bundles the popular Chai assertion library, as well as helpful extensions for Sinon and jQuery, bringing you dozens of powerful assertions for....
Read more >Asserting Expectations
In the previous chapters on tracing and interactive debugging, we have seen how ... line 3, in my_own_assert raise AssertionError AssertionError (expected) ...
Read more >Python | Assertion Error
If the condition is True, the control simply moves to the next line of code. In case if it is False the program...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lucasfcosta , @AndreyBelym , Thanks. I’ll look into this.
@AndreyBelym , if you prefer, I can look into this.