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
Whitney Young
04aa795b73
No longer silently allowing undefined method calls. Fixes #467 .
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
Grant Snodgrass
d0972d2999
Throw when non-existent property is read
2016-06-24 09:39:49 -04:00
lucasfcosta
b9436a9e56
Refactor throw to use checkError module
2016-06-08 20:29:45 -03:00
Grant Snodgrass
16ef15b4ad
Fix failing tests in IE 10 and 11
2016-05-15 09:52:39 -04:00
Tomáš Polomský
bdd558e43f
Fix failure when custom inspect method is used
...
When custom inspect method is used and this method calls stylize test crashes.
Stylize method is documented for Node.js 4.x and 5.x.
2016-04-17 14:27:06 +02:00
meeber
e22835116c
Fix bug when asserting some valid ES6 keys
...
- Resolution of https://github.com/chaijs/chai/issues/674
- Add compareByInspect utility for use with assertKeys sorts
- Add getOwnEnumerableProperties utility
- Add getOwnEnumerablePropertySymbols utility
- Add Symbol support to the inspect utility
- Add tests to utilities, should, expect, and assert
2016-04-11 13:40:34 -04:00
Tobias Bieniek
58532d9b06
test: Add "overwriteMethod" stack trace tests
2016-04-04 16:06:31 +02:00
Tobias Bieniek
c4f522f6fb
test: Add "overwriteProperty" stack trace tests
2016-04-04 13:27:24 +02:00
lucasfcosta
67a3ca5109
Tests to check if addMethod returns a new Assertion instance
2016-03-20 16:14:48 -03:00
Jurko Gospodnetić
568fc1ae0b
fix error message tag substitution
...
String.prototype.replace() had some extra undesireable substitution behaviour
when it replaces a tag with a string containing some internal tags like `$$`,
or `$'`.
For more detailed information see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter
2015-12-14 15:13:03 +01:00
Jurko Gospodnetić
f73d026f28
split up getMessage() tests
2015-12-14 15:04:58 +01:00
Kaito Udagawa
704670a23b
Feature: backslash-escaping in .deep.property
...
This commit includes:
* getPathInfo handles escaping `.[]`
* Documentation added to `.property`
* Documentation added to `.getPathInfo`
* Test cases for `.property`
* Test cases for `.deep.property`
* Test cases for `.getPathInfo`
Note that the input of `.getPathInfo` assumed to match the following:
/^(?:(?:\\[.\[\]]|[^.\[\]])+|\[\d+\])(?:\.(?:\\[.\[\]]|[^.\[\]])+|\[\d+\])$/
2015-03-18 21:57:03 +09:00
Keith Cirkel
7de269af35
Merge pull request #308 from prodatakey/hasproperty
...
Fix properties with `undefined` value pass property assertion
2014-12-02 22:55:14 +00:00
Joshua Perry
dd51594075
More unit tests for new utility functions
2014-11-21 12:27:26 -07:00
Joshua Perry
2d22f4534e
Refactor common functionality, document, test
2014-11-20 16:48:56 -07:00
Julien Wajsberg
84cba222d1
Fix #299 : the test is defining global variables
2014-11-06 12:09:55 +01:00
David da Silva
edef912f41
why not more assertions
2014-11-01 20:24:59 +01:00
David da Silva
627e4b0096
added test for inspecting -0
2014-11-01 20:19:27 +01:00
charlierudolph
216ad26aa1
Allow messages to be functions
2014-06-08 14:00:42 -07:00
Max Edmands
2127525933
util: add overwriteChainableMethod utility (for #215 )
2013-11-30 09:31:06 -08:00
Max Edmands
4ce3d420e2
test: make it possible to run utilities tests with --watch
2013-11-28 13:54:17 -08:00
Jake Luer
a8f94bdcbb
test: [karma] use karma phantomjs runner
...
- tests refactored as bdd instead of tdd
- removed test/browser bootstraps
- add karma-runner
2013-09-17 17:22:36 -04:00
Domenic Denicola
7c72e673f4
Fix utils.inspect
with custom object-returning inspect()s.
...
This code is lifted from the latest node utils.js: 896b2aa707/lib/util.js (L205-L209)
Without it, if an object contains another object whose custom `inspect()` method returns a non-string, `utils.inspect` gets confused and tries to do `nonString.indexOf`.
This fixes domenic/chai-as-promised#32 , where Chai as Promised was trying to call `utils.inspect` on an `AssertionError` which contained as its "actual" property a Q promise. Since Q promises have custom `inspect` methods that return objects, not strings, this was triggered.
2013-06-13 23:12:58 -04:00
Ruben Verborgh
caf2a151c0
Restore the call
and apply
methods of Function when adding a chainable method.
...
This was broken on platforms that have `__proto__` support.
Details at https://github.com/chaijs/chai/commit/514dd6ce4#commitcomment-2593383
2013-02-13 12:41:22 +01:00
Jake Luer
86fe576d56
convert tests to use new bootstrap
2012-11-29 03:18:48 -05:00
Jake Luer
ac52bd12b3
do not write flags to assertion.prototype
2012-10-01 16:13:57 -04:00
Jake Luer
5ed371e655
tests for getPathValue when working with nested arrays. Closes #77
2012-06-24 08:22:12 -04:00
Jake Luer
802856849b
fix bug for missing browser utils
2012-06-24 07:43:50 -04:00
domenic
3a67f058f0
New addChainableMethod
utility.
...
Uses `transferFlags`, and will be used for Chai's `a`/`an` and `includes`/`contains`.
2012-05-26 22:34:55 -04:00
domenic
5455ce4b5d
Replace getAllFlags
with transferFlags
utility.
...
This will help more directly with #66 and with domenic/chai-as-promised#5 .
2012-05-26 21:38:10 -04:00
Jake Luer
6090d77ea8
test - get all flags
2012-05-22 14:51:39 -04:00
John Firebaugh
ce5fc298ab
Use defined return value of Assertion extension functions
2012-05-09 19:22:25 -07:00
Jake Luer
1bb600e996
update util tests for new add/overwrite prop/method format
2012-05-09 18:57:14 -04:00
domenic
3b927d4994
Using message flag in getMessage
util instead of old msg
property.
2012-05-07 18:03:50 -04:00
domenic
8625a5ae09
getMessage
shouldn't choke on null/omitted messages.
...
This came up when doing `assert(false, "message")`.
2012-05-07 17:49:38 -04:00
Jake Luer
4a05659fa0
test for plugin utilities
2012-05-06 06:54:32 -04:00
Veselin Todorov
c268462bf8
Add test for utils.addMethod
2012-04-29 20:51:40 +03:00
Veselin Todorov
f287b09c40
Fix a typo
2012-04-29 17:59:27 +03:00
Veselin Todorov
e3cd113725
Add test for utils.overwriteMethod
2012-04-29 10:21:53 +03:00
Jake Luer
c8c780aa35
beginning utility testing
2012-04-22 15:26:45 -04:00