Commit graph

23 commits

Author SHA1 Message Date
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