Commit graph

756 commits

Author SHA1 Message Date
James Garbutt
f4b2fbc9dc
fix: removes ?? for node compat (#1574)
We shipped syntax which is beyond our `engine` constraint. `??` is
available in node 14 but 4.x is node 4 and above, while 5.x is node 12
and above.

This just dumbs it back down to `||` for now at least.

Fixes #1573
2024-01-12 14:13:18 +00:00
Quentin Barbe
fb5fd85ba1
Allow deepEqual fonction to be configured globally (#1553) 2024-01-05 14:13:06 +01:00
Mark de Dios
b351dc0944
Fix: update exports.version to current version (#1534)
* Change exports.version in lib/chai to 4.3.7

* Update lib/chai/exports.version to 4.3.8
2023-08-24 12:40:14 +01:00
scarf
3a8c49a707
docs: specify return type of objDisplay (#1490)
previously it was incorrectly labeled as `objDisplay(obj: object): void` in `@types/chai`.
2022-12-05 11:20:08 +00:00
Mavaddat Javid
b455124097
test: fix typo in test.js (#1459) 2022-11-12 12:30:59 +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
Keith Cirkel
dc858a0353
chai@4.3.3 2021-03-03 18:20:49 +00:00
Keith Cirkel
3b9bc7f56d
chai@4.3.2 2021-03-03 18:17:46 +00:00
Lee Newson
71245a3e33
Fixed a regression that caused SyntaxErrors on IE 11
The changes made in #1334 incorrectly used an arrow function and as this isn't supported on IE 11 it causes a SyntaxError to be thrown when loading chai.
2021-03-03 18:16:18 +00:00
Keith Cirkel
8a24666156
chai@4.3.1 2021-03-02 18:18:54 +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
Horie Issei
ad385b8481
docs: correct doesNotDecreaseBy name (#1285) (#1286)
Co-authored-by: Issei Horie <is2ei.horie@gmail.com>
2021-02-04 11:08:53 +00:00
Andrzej Bartosiński
4ce3ca83e5
feat: add extra aliases for 'most' and 'least' (#1319) 2021-02-04 11:08:17 +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
Wias Liaw
f5c19e93c8
docs: fix missing arguments in increasesButNotBy (#1361) 2021-02-04 11:03:59 +00:00
Daniel Venturini
6745d8c4f5
docs: fix JSDoc identation (#1355) 2021-02-04 11:01:40 +00:00
Keith Cirkel
39dd113f36
chai@4.3.0 2021-02-04 10:55:37 +00:00
Daniel Venturini
23764f340d
Fix JSDoc name (#1354) 2020-07-13 10:36:46 +01: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
Grigoriy
e54d834be7
test: replaced arrow function for IE support (#1348) 2020-06-12 15:54:07 +01:00
Curtis Gibby
2fb8983f3c
docs: add missing apostrophes (#1344) 2020-06-09 11:16:50 +01: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
Víctor Oliva
9d2f6dc989 docs(oneOf): Add contains flag to oneOf documentation 2019-06-26 23:18:19 +02:00
Víctor Oliva
7eaf684b1a feat(oneOf): expect(value).to.contain.oneOf([]) 2019-06-26 23:18:10 +02: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
Nathan Landis
8d6330cc04 Add delta message to closeTo() error 2019-04-17 16:31:57 -05:00
Grant Snodgrass
26c8a794ec chore: chai@4.2.0 (#1201) 2018-09-26 10:39:58 +01:00
haykam821
ed93c9310f docs: fix unbalanced quotes in assert.notInclude example (#1200)
Some of the examples in assert.notInclude used quotes in the string and for the string itself, so it now uses double quotes to prevent the single quote from breaking the syntax.
2018-09-25 09:58:27 +01:00
Scott Rudiger
0064f26049 feat(assertions): add 'still' language chain (#1194) 2018-09-20 07:28:04 -04:00
Grant Snodgrass
4584706f07 docs: fix bad .string example 2018-05-10 22:38:40 +00:00
Josh Soref
541a932442 chore: spelling: strictly 2018-03-06 05:01:25 +00:00
Josh Soref
8cc21a8b5b chore: spelling: shortcut 2018-03-06 05:01:16 +00:00
Josh Soref
ba3bf3245e chore: spelling: overwrites 2018-03-06 05:00:25 +00:00
Josh Soref
2d9bfc2b8d chore: spelling: assertion 2018-03-06 04:48:45 +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
eebe484d04 docs: fix wrong .property chaining examples (#1130) 2018-01-25 10:40:49 -08:00
Grant Snodgrass
2f46af85f2 fix: remove Chai frames from .deep.equal stack 2018-01-14 20:47:26 +00:00
Grant Snodgrass
d3908a6688
Merge pull request #1117 from s-leroux/assert/fail/only-one-argument
feat: Add the assert.fail([message]) interface
2018-01-12 06:33:46 -05: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
Sophie Alpert
c02f64b160 perf: Optimize proxify and stringDistance (#1098)
- Fill 2D array with ints upfront to reduce property access cost
- Change from recursive to simpler iterative (DP) solution
- Add cap parameter to stringDistanceCapped to limit computation
- Make candidate generation use a simple loop to avoid allocating unnecessary arrays and to call stringDistance only once on each pair of strings instead of every time in the sort callback

This improves chai perf by about 13% on @bmeurer's https://github.com/v8/web-tooling-benchmark.
2018-01-07 20:55:11 +00:00
Colin Eberhardt
f54f71c234 docs: improve throws examples (#1113)
When throws is invoked with two arguments, where the second is a string or regexp, the second argument is the **errMsgMatcher**. The current examples imply that this string is the **message**  rather than the matcher.
2018-01-04 21:31:39 +00:00
Andrew
0af30b79c9 feat(chai/config): add 'catch' to proxyExcludedKeys (#1101)
closes #1050
2017-12-10 18:25:07 +00:00
Benedikt Meurer
eae99d1502 fix: avoid repeated String#slice calls in stringDistance. (#1095)
The `stringDistance` function calls

```js
strA.slice(0, -1)
```

and

```js
strB.slice(0, -1)
```

multiple times, which is a bit of a waste of time here. JavaScript
engines cannot generally eliminate the duplicated calls easily, so
it's better to avoid the redundant calls altogether.

This improves the chai test on the
[web-tooling-benchmark](https://github.com/v8/web-tooling-benchmark) by
around 8% when run with upcoming V8 6.4.
2017-12-02 09:29:39 -02: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
1c1b07490b Remove meaningless processing
numLinesEst does not seem to be used anywhere after this.
2017-09-13 15:10:14 +09:00
abetomo
62baf22a44 Fix string enclosed in single quotes in core/assertions.js
In other code in this file, the string was enclosed in single quotes
2017-09-13 15:10:14 +09:00