Proxy-related implementation frames were showing up in the stack
traces for failed property assertions. This commit removes them by
setting the proxy getter (instead of the property getter) as the
starting point to remove all implementation frames.
Only a couple of types of assertions were being tested for correct
stack traces. This commit cleans up the existing tests and adds tests
for the missing assertion types.
Currently, only one module needs to detect if Chai's proxy protection
is enabled. However, upcoming changes will involve performing this
detection in other modules as well. This commit moves the detection
logic to its own utility module for easy reuse.
When the `length` assertion is chained directly off of an uninvoked
method, it references `function`'s built-in `length` property instead
of Chai's `length` assertion. This commit adds a guard to Chai methods
to detect this problem and throw a helpful error message that advises
the user on how to correct it.
- The method part of the `length` assertion was slated for deprecation
due to a compatibility issue in legacy environments. The decision to
deprecate `length` was reversed per #684. This commit replaces the
deprecation notice with a recommendation to favor `lengthOf` over
`length` due to the compatibility issue.
- The `lengthOf` assertion wasn't a true alias of `length` because it
was a method assertion instead of a chainable method assertion. This
commit changes `lengthOf` into a chainable method assertion that's
identical to `length`, and updates tests and docs accordingly.
- Updates docs to classify `length` as an alias of `lengthOf`.
- Updates docs of related assertions to use `lengthOf` instead of
`length`.
Three tests on the `should` interface are failing in Safari 10 due to a
bug related to proxies. These tests should be re-enabled once the bug is
fixed. See https://github.com/chaijs/chai/issues/855.
- Use typeof instead of type-detect whenever possible for performance
- Fix casing whenever type-detect is used per v3.0.0 breaking change
- Remove duplicate type-detect calls by storing results in variables
* Make 'empty' throw on non-string primitives and functions
* Update jsdoc
* improve error messages
* fix symbol to string coercion for Node 0.12
* use utils.inspect
- Add `own` flag
- Make `ownProperty` and `haveOwnProperty` aliases of `own.property`
- Add `deep` support to `own.property`
- Add `assert.deepOwnPropertyVal`
- Add `assert.notDeepOwnPropertyVal`