Skip to content
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

Un-deprecate length and add guard #897

Merged
merged 2 commits into from
Jan 3, 2017
Merged

Commits on Jan 2, 2017

  1. refactor(lengthOf): favor it over length

    - 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 chaijs#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`.
    meeber committed Jan 2, 2017
    Configuration menu
    Copy the full SHA
    ae69f27 View commit details
    Browse the repository at this point in the history

Commits on Jan 3, 2017

  1. feat(utils): add length guard to methods

    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.
    meeber committed Jan 3, 2017
    Configuration menu
    Copy the full SHA
    ce9a2c2 View commit details
    Browse the repository at this point in the history