Commit graph

1454 commits

Author SHA1 Message Date
Grant Snodgrass
e7b23846b4 refactor: expectTypes to access ssfi flag
The `ssfi` flag doesn't need to be passed to the `expectTypes`
util function because it can access it directly from the assertion
object.
2017-06-11 08:33:48 -04:00
Grant Snodgrass
e6ddf64c8f fix: check target's type in .property assertion
Previously, the `.property` assertion failed ungracefully if the target was `null` or `undefined`. This commit causes an `AssertionError` to be thrown instead so that the ssfi flag and custom error messages are respected.
2017-06-10 17:51:50 -04:00
Sam Lanning
7e466af33b Add a missing var keyword found by lgtm.com 2017-06-05 18:50:33 -07:00
Lucas Fernandes da Costa
616cf8bf88 Revert get version package json (#986)
* Revert getting version from package.json

* chai@4.0.2
2017-06-05 14:12:19 -03:00
Keith Cirkel
b38b8d7659 fix: (#978) remove browser field (#982)
This removes the browser field which was used incorrectly. It is not needed for chai, and bundlers should bundle the commonjs code instead.
2017-05-31 18:01:31 -03:00
greenkeeper[bot]
eba5b420f8 chore(package): update browserify to version 14.4.0 2017-05-29 08:54:42 +00:00
Anderson Aguiar
d0ace69b68 Update supported node version badge in README FIX #975 2017-05-27 11:41:29 -03:00
Keith Cirkel
ab1fbadcfe Merge pull request #973 from chaijs/chore-uncomment-travis-deploy
chore: uncomment travis lines
2017-05-26 10:58:22 +01:00
Keith Cirkel
545ca2f0a6 chore: uncomment travis lines
This allows us to release on tags, for the upcoming 4.0
2017-05-26 10:24:51 +01:00
Keith Cirkel
6349ff4731 Merge pull request #972 from lucasfcosta/release-4.0.0
Release chai@4.0.0
2017-05-26 10:15:26 +01:00
lucasfcosta
0fe98b14fe chai@4.0.0 2017-05-25 19:45:31 -03:00
Lucas Vieira
30a44513f4 Merge pull request #967 from lucasfcosta/remove-lib-bump
Remove bump command to change lib/chai.js
2017-05-09 22:08:23 -03:00
lucasfcosta
8ba95a7620 Remove bump command to change lib/chai.js 2017-05-09 19:44:30 -03:00
Keith Cirkel
0825826059 Merge pull request #964 from zetamorph/assert-nestedInclude-ownInclude
assert: add nestedInclude, deepNestedInclude, ownInclude and deepOwnInclude
2017-05-09 10:08:36 +01:00
Grant Snodgrass
f3adfd911e fix: PhantomJS 1.x incompatibility (#966) 2017-05-08 17:22:54 -03:00
Johannes Loewe
b744130df9 Assert: made documentation more descriptive
Assert: made documentation more descriptive
2017-05-07 14:49:42 +02:00
Johannes Loewe
33e4403671 test: added custom message test to negated .nested-, .deep-, .own.include 2017-05-05 00:55:34 +02:00
Johannes Loewe
4180242e83 test: added message argument to negated nested-, deep-, own- and deepOwnInclude 2017-05-05 00:54:11 +02:00
Johannes Loewe
40bb490060 assert interface: add .deepOwnInclude and notdeepOwnInclude 2017-05-05 00:54:11 +02:00
Johannes Loewe
97b6243431 assert interface: add .ownInclude and .notOwnInclude 2017-05-05 00:54:11 +02:00
Johannes Loewe
24d7fa3849 assert interface: add deepNestedInclude and notDeepNestedInclude 2017-05-05 00:54:11 +02:00
Johannes Loewe
7063b940a8 assert interface: add nestedInclude and notNestedInclude 2017-05-05 00:54:10 +02:00
Johannes Loewe
875057d8ea test: add assert.deepOwnInclude and assert.notDeepOwnInclude 2017-05-05 00:54:10 +02:00
Johannes Loewe
889b489fe9 test: add assert.deepNestedInclude and assert.notDeepNestedInclude 2017-05-05 00:54:10 +02:00
Johannes Loewe
a5691d32c5 test: add assert.ownInclude and assert.notOwnInclude 2017-05-05 00:54:10 +02:00
Johannes Loewe
479e4c46de test: add assert.nestedInclude and assert.notNestedInclude 2017-05-05 00:54:10 +02:00
Keith Cirkel
850bd7e016 Merge pull request #957 from keithamus/release/4.0.0-canary.2
chore: release 4.0.0-canary.2
2017-04-12 23:12:37 +01:00
Keith Cirkel
7db8c6ce28
chore: temporarily comment out deploy whlile we're canary 2017-04-12 10:31:30 +01:00
Keith Cirkel
4c2c3d8935
chore: release 4.0.0-canary.2 2017-04-11 21:22:32 +01:00
Keith Cirkel
526f88585d Merge pull request #920 from meeber/update-docs
Overhaul bdd documentation
2017-04-11 21:10:23 +01:00
Grant Snodgrass
f80d699a50 docs: overhaul bdd documentation 2017-04-08 21:41:45 -04:00
Grant Snodgrass
dce6415d0a style: rename target argument to subject
Most assertions use the term "target" to refer to the object under
test, but a few assertions also had a `target` argument, resulting in
an overloaded term that was difficult to document. This commit
renames every `target` argument to `subject`.
2017-04-08 09:23:27 -04:00
Keith Cirkel
a515ece48a Merge pull request #947 from meeber/fix-messages
fix: always honor custom message
2017-04-05 12:12:18 +01:00
Grant Snodgrass
7f8a268e52 fix: always honor custom message 2017-04-04 17:28:19 -04:00
Keith Cirkel
e5ac3b0874 Merge pull request #922 from meeber/remove-chai-frames
Remove implementation frames from stack trace
2017-04-04 22:22:13 +01:00
Grant Snodgrass
a253b4c50e docs: remove excessive comments from tests 2017-03-23 18:20:41 -04:00
Grant Snodgrass
8fad9c8000 refactor: rename keep_ssfi to lockSsfi 2017-03-23 18:20:41 -04:00
Grant Snodgrass
b584b94c24 fix: remove frames from assert interface stack
- Make it so that only `AssertionError` is thrown from inside of an
  assert interface wrapper function

- Always set `ssfi` to the current function when creating a new
  `AssertionError` inside of an assert interface wrapper function

- Always set `ssfi` to the current function when creating a new
  `Assertion` inside of an assert interface wrapper function,
  and set the `keep_ssfi` flag

- Improve the `globalErr` test helper function to also validate that the
  thrown error's stack trace doesn't contain frames from the assert
  interface
2017-03-23 18:20:41 -04:00
Grant Snodgrass
4b090100aa fix: remove frames from bdd interface stack
- Make it so that only `AssertionError` is thrown from inside of an
  assertion

- Always pass the current `ssfi` to a `new AssertionError` inside of an
  assertion

- Always pass the current `ssfi` to a new `Assertion` inside of an
  assertion, and set the `keep_ssfi` flag

- Improve the `globalErr` test helper function to also validate that
  the thrown error's stack trace doesn't contain implementation frames
2017-03-23 18:20:38 -04:00
Grant Snodgrass
cf84f95505 feat: improve keep_ssfi flag
- Allows the `keep_ssfi` flag to be set when creating new Assertion
  objects by providing its value as the fourth argument.

- Updates the `transferFlags` util to only transfer `keep_ssfi` when the
  `includeAll` argument is set to `true`.

- Updates assertion creation and proxify utils to only set `ssfi` if
  `keep_ssfi` isn't set.

- Updates inline docs to reflect expanded usage of `keep_ssfi`.
2017-03-23 18:04:15 -04:00
Keith Cirkel
ef2bf66d7c Merge pull request #899 from lucasfcosta/throw-for-non-functions-on-instanceof
Throw error when instanceof is passed something that is not a function as constructor
2017-03-23 09:55:55 +00:00
Keith Cirkel
011612c7b3 Merge pull request #924 from meeber/fix-not-have-keys
fix: make negated `.keys` consider size of sets
2017-03-23 09:54:24 +00:00
lucasfcosta
011815305a Throw error when instanceof is passed something that is not a function as constructor 2017-02-15 21:56:26 -02:00
Grant Snodgrass
a7e1200db4 fix: wrong assertion types (#925)
BREAKING CHANGE: `.change`, `.increase`, and `.decrease` changed from
Chainable Method Assertions to Method Assertions. They don't have any
chaining behavior, and there's no generic semantic benefit to chaining
them.
2017-02-13 22:23:54 -02:00
Lucas Vieira
f937ee5be0 Merge pull request #926 from meeber/missing-include-tests
test: add `.own.include` and `.nested.include`
2017-02-07 10:17:37 -02:00
Grant Snodgrass
a6e172168c test: add .own.include and .nested.include 2017-02-02 18:47:50 -05:00
Grant Snodgrass
f37d2c223b fix: make negated .keys consider size of sets
When neither the `contains` nor `any` flags are set, the `.keys`
assertion implicitly means `.all.keys` and thus requires the target
and given sets to be the same size. Therefore, `not.keys` implicitly
means `.not.all.keys`, and should thus pass when the target and given
sets aren't the same size, even if the target set is a superset of the
given set. This commit enables this behavior.
2017-01-30 18:34:42 -05:00
Grant Snodgrass
576a6f7153 Merge pull request #915 from chaijs/greenkeeper/get-func-name-2.0.0
Update get-func-name to the latest version 🚀
2017-01-24 14:44:05 -05:00
greenkeeper[bot]
8c25fd077f fix(package): update get-func-name to version 2.0.0
https://greenkeeper.io/
2017-01-24 19:34:29 +00:00
Keith Cirkel
4b7b70ce12 Merge pull request #911 from aaronsofaly/fix-plugin-utilities-documentation
Fix plugin utilities documentation
2017-01-23 20:20:45 +00:00