Commit graph

368 commits

Author SHA1 Message Date
Aleksey Shvayka
c38bfec30c Make empty assertion work with es6 collections (#814)
* support Map and Set

* throw on weak collections

* called on => passed

* account for partial implementations
2016-10-02 15:33:59 -03:00
Aleksey Shvayka
5b170b2e3b Make 'empty' throw on non-string primitives and functions (#812)
* Make 'empty' throw on non-string primitives and functions

* Update jsdoc

* improve error messages

* fix symbol to string coercion for Node 0.12

* use utils.inspect
2016-10-01 15:58:45 -03:00
Grant Snodgrass
5dd96a0a3d Merge pull request #810 from meeber/refactor-own-property
Refactor `ownProperty`
2016-09-29 16:12:38 -04:00
Grant Snodgrass
edfe064774 Refactor ownProperty
- Add `own` flag
- Make `ownProperty` and `haveOwnProperty` aliases of `own.property`
- Add `deep` support to `own.property`
- Add `assert.deepOwnPropertyVal`
- Add `assert.notDeepOwnPropertyVal`
2016-09-28 17:24:00 -04:00
Grant Snodgrass
1f36393d1c Standardize failed property assertion messages 2016-09-28 06:51:26 -04:00
lucasfcosta
9498811fe2 Deep flag support for keys assertion 2016-09-27 18:00:14 -03:00
Grant Snodgrass
eac90a5209 Wrap non-chainable methods in proxies 2016-09-25 20:13:19 -04:00
lucasfcosta
fdc1dbc42b Fix bug when trying to call inspect on an Assertion 2016-09-22 19:38:19 -03:00
Lucas Vieira
d0242ee9e5 Not check instaceOf if __proto__ is not supported 2016-09-19 15:26:35 -03:00
Lucas Fernandes da Costa
7683356fff Merge pull request #799 from vieiralucas/consistency-return-new-assertion
Return new assertion with flags copied over instead of this. Fix #791
2016-09-19 11:25:43 -03:00
Lucas Vieira
5d11228cfa Wrap some utilities tests with describe so we can cleanup in an after block even if they fail 2016-09-18 23:04:06 -03:00
Lucas Vieira
1ae0a41be2 Return new assertion instead of this for overwriteChainableMethod 2016-09-15 02:34:27 -03:00
Lucas Vieira
f6c4fa3939 Remove new methods and properties after using them for test 2016-09-15 02:34:27 -03:00
Lucas Vieira
27f426557d Return new assertion instead of this for addChainableMethod 2016-09-15 01:00:01 -03:00
Lucas Vieira
4501970540 Return new assertion instead of this for overwriteMethod 2016-09-15 01:00:01 -03:00
Lucas Vieira
031085d1d9 Add toJSON to proxyExcludedKeys 2016-09-15 00:03:16 -03:00
Lucas Vieira
4101fdfbfd Return new assertion instead of this for overwriteProperty 2016-09-14 13:39:31 -03:00
Lucas Fernandes da Costa
662b76c82d Merge pull request #796 from vieiralucas/verify-type-round2
Verify types on increase | decrease
2016-09-12 15:01:45 -03:00
Lucas Vieira
c802d38dbe Add tests that ensure assert.atMost and assert.atLeast are checking type 2016-09-10 17:01:26 -03:00
Lucas Vieira
43b22c8fac Verify types on increase | decrease 2016-09-10 17:00:13 -03:00
Grant Snodgrass
e24b66ee49 Fix broken tests when using Node v6.5 2016-09-10 15:06:03 -04:00
Grant Snodgrass
4a009decbf Fix broken test after rebasing 4.x.x branch 2016-09-08 09:37:23 -04:00
Lucas Vieira
c3e828534b Verify types on within and related assertions 2016-09-08 09:37:23 -04:00
lucasfcosta
df1a89241b ownProperty assertions on Assert interface 2016-09-08 09:37:22 -04:00
lucasfcosta
16101af347 Assertion subject (obj) changes when using ownProperty assertion 2016-09-08 09:37:22 -04:00
lucasfcosta
01189490bd Truncate typedArrays according to their string representation 2016-09-08 09:37:22 -04:00
lucasfcosta
4d314b614b Fix truncateThreshold 2016-09-08 09:37:22 -04:00
lucasfcosta
aae52f2f42 Minor inspect code style fixes 2016-09-08 09:37:22 -04:00
lucasfcosta
b90ba4e5a0 Truncate long typedArray 2016-09-08 09:37:22 -04:00
lucasfcosta
8123bf778c formatTypedArray function 2016-09-08 09:37:22 -04:00
lucasfcosta
0a8869643c New showDiff behaviour also depending on expected and actual values 2016-09-08 09:37:22 -04:00
Whitney Young
04aa795b73 No longer silently allowing undefined method calls. Fixes #467. 2016-09-08 09:37:22 -04:00
Sakthipriyan Vairamani
d2884a6baa handle NaN properly in assertions
Fixes: #498
2016-09-08 09:37:22 -04:00
Dai
128c1126ac Updated code based on discussion 2016-09-08 09:37:22 -04:00
Dai
e0ee3def23 Added handling for undefined and null (fails on negate flag too) 2016-09-08 09:37:22 -04:00
not-an-aardvark
e8085b0ad8
Add fix suggestions when accessing a nonexistent property in proxy mode
fixes #771
2016-09-07 21:34:29 -04:00
Keith Cirkel
d521ed8f18 Merge pull request #779 from TheSavior/is-finite
Adding `.finite`. Fixes #271
2016-09-02 17:30:52 +01:00
Eli White
f26e415be5 Use a property assertion and update tests 2016-09-01 20:55:09 -07:00
Grant Snodgrass
a42586e494 Merge pull request #774 from lucasfcosta/configurable-blacklist
Configurable proxy blacklist
2016-09-02 09:45:32 +08:00
Eli White
754bd2415d Adding tests for should. Fixing comment 2016-09-01 12:57:30 -07:00
Eli White
9d914143fc Adding .finite. Fixes #271 2016-09-01 10:34:58 -07:00
lucasfcosta
0c06de5a80 Add proxyExcludedKeys config setting. Closes #765 2016-08-31 19:42:15 -03:00
lucasfcosta
374f405527 Exist assertion on the assert interface 2016-08-26 21:16:35 -03:00
lucasfcosta
e731740d5c Exist assertion using triple equals and minor style fixes for it 2016-08-26 21:02:27 -03:00
Keith Cirkel
49ed210e6f Merge pull request #761 from meeber/deep-include
Add `.deep.include` for deep equality comparisons
2016-08-16 21:04:56 +01:00
Lucas Fernandes da Costa
70d8fe2f4b Merge pull request #760 from meeber/fix-include
Breaking: Fix `.include` to always use strict equality
2016-08-15 15:39:51 -03:00
Lucas Fernandes da Costa
dcd5524d8a Merge pull request #758 from meeber/deep-property
Add `.deep.property` for deep equality comparisons
2016-08-15 15:36:58 -03:00
Lucas Fernandes da Costa
0662b7bafa Merge pull request #770 from vieiralucas/optional-proxy
Make proxies optional
2016-08-15 15:35:41 -03:00
Lucas Vieira
0f34cb50a5 Make proxies optional 2016-08-15 13:18:28 -03:00
Grant Snodgrass
7d1dd301c1 Add .deep.include for deep equality comparisons 2016-08-14 16:08:09 -04:00