Various work on aliases #489

Merged
merged 7 commits into from Jul 19, 2015

Projects

None yet

2 participants

@astorije
Member

Here is what this PR does:

  • Add is* aliases for extensible, notExtensible, sealed, notSealed, frozen, notFrozen and update their respective tests to test the aliases
  • Add is* aliases for ok and notOk and update their respective tests to test the aliases
  • Make the use of throws consistent: before these changes, the name of the assertion in the documentation was throws, the examples were using throw and the code was using Throw. Now it's throws everywhere and the rest is aliases
  • Add tests for aliases of throws (throw and Throw)
  • Since we already had isTrue, isNull, isObject, isBoolean, ... (20 in total), I made the is* aliases the authoritative source, and kept the original ones as aliases for backward-compatibility. For example, isOk should be the "official" version (like isTrue), but ok still exists. If I am not committing any typo, nothing in the API will be broken, just the way it's presented is more consistent.

This PR doesn't update the main chai.js file.

@astorije
Member

I can also add tests for theses aliases, to make sure they run OK. Let me know if you want that.

@keithamus
Member

If you would kindly add tests, then I'll happily merge 😄

@astorije astorije changed the title from Aliases to frozen/notFrozen, sealed/notSealed and extensible/notExtensible to Various work on aliases Jul 18, 2015
@astorije
Member

@keithamus here you go with the tests... I also took some liberties as you can see, making this PR broader but still focused on aliases for the assert API. I believe it makes things better by adding consistency and tests, I hope you're gonna like it :)

Let me know if you need anything else on this!

@astorije
Member

Note that since there are a lot of changes, I made sure individual commits were self-contained so that you can go through each of them instead of having to digest the resulting blob in one go!

@keithamus
Member

LGTM 👍

@keithamus keithamus merged commit 40cdaa3 into chaijs:master Jul 19, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@astorije astorije deleted the astorije:astorije/aliases branch Jul 19, 2015
@astorije
Member

Thanks @keithamus!!

@marekventur marekventur referenced this pull request in Gamevy/pixi-packer Dec 14, 2015
Merged

Update "chai" to version ^3.4.1 #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment