Commit graph

437 commits

Author SHA1 Message Date
Quentin Barbe
fb5fd85ba1
Allow deepEqual fonction to be configured globally (#1553) 2024-01-05 14:13:06 +01:00
Scott Newcomer
8e780b44f3
fix: deep-eql bump package to support symbols comparison (#1483) 2022-11-07 16:25:03 +00:00
Pascal Corpet
c8a4e00c51
feat: use chaijs/loupe for inspection (#1401) (#1407)
Fix #1228
2021-07-08 09:52:49 +01:00
Mike Frysinger
5b607a144e
fix: support inspecting bigints (#1321) (#1383) 2021-03-12 16:49:06 +00:00
Blake Regalia
de12e401bc
feat: add exists alias (#1227)
* feat(assertions): add 'exists' alias (#1225)

* docs(assertions): remove bad `exists` example

* test(assertions): add `exists` cases

* test(should): remove `exists` tests from should interface
2021-02-04 11:10:23 +00:00
sportshead
77565f7c2c
feat: add also language chain (#1324)
* Add `also` language chain

This would be helpful, as the property doesn't clash with other methods.

* Add `also` to tests
2021-02-04 11:07:26 +00:00
Rens Groothuijsen
817284c01b
feat: add "deep" flag in oneOf (#1334) 2021-02-04 11:06:59 +00:00
David Luzar
b91d0a842c
fix: unbox BigInt primitives in shouldGetter (#1349)
* unbox BigInt primitives in shouldGetter

* add tests
2020-06-17 17:23:03 +01:00
Gil Tayar
e08ca08f3b
feat: add Node.js ESM entry point with named and default exports (#1340)
* add Node.js ESM entry point with named and default exports

* ensure that deep importing works
2020-06-09 11:17:41 +01:00
flaambe
0e543bf9b3 test: The Buffer() and new Buffer() constructors are deprecated (#1305) 2020-01-22 10:12:57 +00:00
Ruwan Pradeep Geeganage
7ff1273142 feat: improve include error message (#1273) 2019-08-19 14:30:05 +01:00
Lucas Vieira
03913cbaa1
Merge pull request #1242 from voliva/contains-oneOf
(feat): expect value to contain oneOf
2019-06-27 21:19:40 -03:00
Ruwan Pradeep Geeganage
8dc92d870a Adding operator attribute to assertion error (#1257)
* feat: adding operator attribute to assertion error

You can set the operator as mentioned below.
flag(this, 'operator', MYOPERATOR).
for example,
flag(obj, 'operator', 'notEqual')
2019-06-25 14:39:16 -03:00
Lucas Vieira
42509fac01 test: make sure that useProxy config is checked in overwriteProperty 2019-06-05 15:26:38 -03:00
Nathan Landis
6bfd2fd131 Include some missed some test files 2019-04-17 16:44:03 -05:00
Nathan Landis
8d6330cc04 Add delta message to closeTo() error 2019-04-17 16:31:57 -05:00
Víctor Oliva
5930c0112f test(oneOf): Add failing tests for contain.oneOf 2019-03-12 17:33:22 +01:00
Scott Rudiger
0064f26049 feat(assertions): add 'still' language chain (#1194) 2018-09-20 07:28:04 -04:00
Adi Prasetyo
11612e97da test(assert): add spec with getterFn. (#1085)
- on changes, decreases and increases family
2018-03-17 19:15:09 +00:00
Grant Snodgrass
d89a9fe470 test: stop modifying globals in Proxy tests 2018-03-03 18:11:21 +00:00
asbish
97e24930bc feat: .lengthOf for Maps and Sets (#1131)
* feat: Add support for Map and Set to .lengthOf

* docs: Fix about .lengthOf
2018-02-11 15:33:32 +00:00
Grant Snodgrass
2f46af85f2 fix: remove Chai frames from .deep.equal stack 2018-01-14 20:47:26 +00:00
Sylvain Leroux
0d1b5862fe feat: Add the .fail([message]) interface
Fix #1116.
The `assert.fail` interface should accept being called with
only 1 arguments to fail with a custom message.
2018-01-12 08:32:57 +01:00
Andrew
0af30b79c9 feat(chai/config): add 'catch' to proxyExcludedKeys (#1101)
closes #1050
2017-12-10 18:25:07 +00:00
Simone Vittori
9a6610eb1e docs: fix typos and remove trailing whitespaces (#1042) 2017-11-22 22:02:05 +00:00
Ankit Singh
3ace4a0bbd property assertion should only accept strings if nested, fixes #1043 (#1044)
* property assertion should only accept strings if nested, fixes #1043

* similar logic seperated out

* test cases for fix #1043

* type check if not isNested with tests

* Tests for assert and should inteface

* Error message change

* changes in should and assert tests as per review

* assert tests modified

* Review comments changes

* review comments fixes
2017-10-02 17:44:05 -03:00
abetomo
d9aa813974 Remove unnecessary line feeds 2017-09-12 18:57:54 +09:00
Aleksey Shvayka
300b994ad3 do not attempt to define properties on primitives 2017-09-06 22:19:26 +03:00
Aleksey Shvayka
d4fde80a3c fix instanceof rethrow test 2017-09-06 22:19:10 +03:00
Aleksey Shvayka
6586e2dcbe add missing vars 2017-09-06 22:18:25 +03:00
Grant Snodgrass
c01cf30de9 fix: .include to work with all objects
Overly strict type-checking was causing `.include` to reject `Error`
objects and objects with a custom `@@toStringTag`.
2017-07-31 17:22:58 -04:00
Grant Snodgrass
c107abb319 fix: .instanceof to allow DOM interfaces in IE11 2017-07-24 18:57:42 -04:00
Grant Snodgrass
11a6f8502f test: skip failing .include tests in IE11
Contrary to spec, IE11 uses SameValue instead of SameValueZero
equality for Sets.
2017-07-09 19:01:00 -04:00
Aleksey Shvayka
2eddd79002 Add ES6 collection support to include() (#994)
* fix error messages tests

* add tests

* add implementation

* performance tweaks

* add tests for SameValueZero

* drop weakmap support

* update docs
2017-06-23 15:35:07 -07:00
Vlad Kolbaya
3c932e21e6 feat: allow dates for isBelow and isAbove assertions (#990)
* Fixed most tests

* Fix date uniformity (UTC)

* Add comment

* Cleanup

* Change extra functions (WIP)

* Finished tests

* Add master chai.js back

* Uncomment failing tests

* Update master and tests

* Actual seconds, duh

* Refactor 'above'

* Update all methods

* More explicit error

* Documentation - articles consistency

* Custom message test in assert

* No parenthesis in should

* Custom message for isAbove
2017-06-23 12:54:23 +01: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
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
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
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
Grant Snodgrass
7f8a268e52 fix: always honor custom message 2017-04-04 17:28:19 -04: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