Commit graph

458 commits

Author SHA1 Message Date
toastynerd
498fe95126 add the which chain method as per issue #347 2015-01-22 09:07:59 -08:00
Keith Cirkel
5fc486b573 Merge pull request #333 from cmpolis/change-assertions
Added `change`, `increase` and `decrease` assertions with `by` chain (#330)
2015-01-02 19:08:10 +00:00
Chris Polis
a6692349c5 more by cleanup 2015-01-02 10:16:25 -08:00
Chris Polis
051fd95d88 cleaned out .by for #333 2015-01-02 10:13:44 -08:00
Michael Lange
ebcfd87a0e Expose chai util through the chai object
The chai util object has a lot of useful functions that can be used
outside of the context of assertions.
2014-12-30 13:19:45 -08:00
Chris Polis
581cf83b11 cleanup (per notes on pr #333) 2014-12-29 09:47:32 -08:00
Chris Polis
cb1c33b5d8 updated change to work w/ non-number values + tests 2014-12-29 09:45:25 -08:00
Adam Hull
0eb70e1955 Typo, the flag is called 'contains' with an 's' 2014-12-28 22:16:17 -05:00
Chris Polis
647e49c8e4 updated assertion interface with change (#330) 2014-12-27 17:52:50 -08:00
Chris Polis
34576803ec added change,increase,decrease assertions (#330) 2014-12-27 17:43:27 -08:00
Mathias Schreck
061c79051a Add includes and contains alias (fixes #327) 2014-12-24 17:53:04 +01:00
Chasen Le Hara
24735f14b7 Fix docs for overwriteChainableMethod parameters 2014-12-14 21:42:45 -08:00
Keith Cirkel
874ac20541 Merge pull request #317 from jasonkarns/patch-2
minor docs typo
2014-12-09 21:04:27 +00:00
Keith Cirkel
2aa6eb6392 Merge pull request #318 from jasonkarns/patch-3
typos in docs
2014-12-09 21:04:15 +00:00
Jason Karns
9db0626783 typos in docs 2014-12-09 09:12:22 -05:00
Jason Karns
d2c4c3f79d minor docs typo 2014-12-09 09:11:06 -05:00
Jason Karns
7ee2c18cf7 update docs: getAllFlags -> transferFlags
Documentation was out of date
2014-12-09 09:09:07 -05:00
Chris Jones
e0e06082ea Added the all and any flags for keys assertion, with all being the default behavior
Extended keys documentation and set bools instead of changing flags in the keys assertion

Miswrote in keys documentation, corrected mistake

Edited documentation for keys to better match how it interacts with contains and have
2014-12-03 18:00:42 -05:00
Chris Jones
0d814eb6f2 Changed public comment of sameDeepMemebers to be more clear 2014-12-02 19:38:07 -05:00
Chris Jones
e3e170d3e0 Fixes issue #291, adds assert.sameDeepMembers 2014-12-02 19:38:07 -05:00
Keith Cirkel
49e003c1f2 Merge pull request #311 from cjqed/305-above-below-on-assert
Issue #305 fixed, added assert.isAbove and assert.isBelow
2014-12-02 22:56:11 +00: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
Chris Jones
e8e8caf4c2 Issue #305 fixed, added assert.isAbove and assert.isBelow 2014-11-29 01:52:00 -05:00
Joshua Perry
414dea2881 Fix typo 2014-11-21 15:07:26 -07:00
Joshua Perry
2d22f4534e Refactor common functionality, document, test 2014-11-20 16:48:56 -07:00
Joshua Perry
8cdb7b1d76 Refactor if statement out 2014-11-18 17:42:30 -07:00
Joshua Perry
7d466b2d37 Handle array indexing terminating paths 2014-11-18 17:18:00 -07:00
Joshua Perry
32826c06df Fix properties with undefined value pass property assertion 2014-11-15 16:29:57 -07:00
Keith Cirkel
b826feba51 Revert "Allows writing lint-friendly tests" 2014-11-13 11:58:50 +00:00
Jake Luer
c8b3208ce4 Release 1.10.0 2014-11-10 09:06:08 -05:00
Keith Cirkel
828f48148f Merge pull request #297 from prodatakey/noopchainfunc
Allows writing lint-friendly tests
2014-11-10 09:44:19 +00:00
Joshua Perry
c448e1de7c Revise documentation wording 2014-11-05 07:25:26 -07:00
Joshua Perry
bbd3aafbe5 Add docs for function style NOOP asserts 2014-11-04 10:27:43 -07:00
Joshua Perry
9142ce0cfd Make the NOOP function a shared constant 2014-11-04 09:25:31 -07:00
David da Silva
cec4ac1ed7 a more readable/simple condition statement, as pointed out by @keithamus 2014-10-31 15:20:12 +01:00
David da Silva
cbf76dcde8 added check for logging negative zero 2014-10-31 11:40:51 +01:00
Joshua Perry
4b0c0b6222 Allows writing lint-friendly tests
This makes the final assertion checks noop functions so that they can be formatted like function calls. This keeps linters (JSLint/JSHint) off our back for having an inop expression.

Completes #41
2014-10-13 16:31:17 -06:00
Jake Luer
15eab030b7 Release 1.9.2 2014-09-29 19:24:59 -04:00
Jake Luer
834fd5b0dd Merge pull request #268 from charlierudolph/cr-lazyMessages
Allow messages to be functions
2014-09-29 18:18:25 -04:00
Jake Luer
7e28dcc267 Merge pull request #269 from charlierudolph/cr-codeCleanup
Remove unused argument
2014-09-29 18:17:03 -04:00
Jake Luer
6e65020d2e Merge pull request #277 from charlierudolph/fix-doc
Fix assert documentation
2014-09-29 18:16:24 -04:00
Jake Luer
3e692e6d04 Merge pull request #279 from mohayonao/fix-closeTo
fix: closeTo should check value's type before assertion
2014-09-29 18:15:53 -04:00
Jake Luer
a9c974a926 Merge pull request #289 from charlierudolph/cr-dryUpCode
Dry up code
2014-08-30 11:26:25 -04:00
charlierudolph
0a1812c9c9 Dry up code 2014-08-27 13:24:51 -07:00
mohayonao
11fe70ef82 assert: .closeTo() verify value's type before assertion 2014-07-16 09:50:45 +09:00
Martin Middel
4b31574658 Rewrite pretty-printing HTML elements to prevent throwing internal errors
Fixes errors occuring when using a non-native DOM implementation
2014-06-30 20:38:14 +02:00
charlierudolph
7a0a6daeaa Fix assert documentation 2014-06-27 16:27:05 -07:00
charlierudolph
e8ff325d0e Remove unused argument 2014-06-08 14:06:56 -07:00
charlierudolph
216ad26aa1 Allow messages to be functions 2014-06-08 14:00:42 -07:00
Chris Thompson
f99845c056 Show diff for keys assertion 2014-05-28 09:49:54 -06:00
Jake Luer
b7fdf4919e Release 1.9.1 2014-03-19 12:22:08 -04:00
Jake Luer
1df11d0027 util: [getActual] select actual logic now allows undefined for actual. Closes #183 2014-03-18 09:35:43 -04:00
Jake Luer
a0661120d9 docs: [config] make public, express param type 2014-03-18 08:44:31 -04:00
Roman Masek
9e5f9ffd3b Fix issue #166 - configurable threshold in objDisplay. 2014-03-18 08:20:15 +01:00
Roman Masek
7dd05e3b7a Move configuration options to config.js. 2014-03-18 08:18:11 +01:00
Jake Luer
07b34c7b49 Merge pull request #233 from Empeeric/master
ssfi as it should be
2014-02-25 12:43:59 -05:00
Jake Luer
4e25ff0e1c Merge pull request #244 from leider/fix_for_contains
fixing #239 (without changing chai.js)
2014-02-25 12:43:43 -05:00
Dido Arellano
82ccc5e75b Fix typos 2014-02-23 02:39:30 +08:00
Luís Cardoso
03344cb48d Update exports.version to 1.9.0 2014-02-14 19:10:29 +00:00
leider
2c78b57824 aborting loop on finding 2014-02-09 15:52:58 +01:00
leider
350a802a4e declaring variable only once 2014-02-09 14:42:00 +01:00
leider
cb910afc52 additional test finds incomplete implementation 2014-02-09 14:41:03 +01:00
leider
76b62f006f simplified code 2014-02-09 14:29:18 +01:00
leider
7352fdeec7 fixing #239 (without changing chai.js) 2014-02-09 13:31:45 +01:00
Refael Ackermann
62d9ceb208 ssfi as it should be 2014-01-30 10:23:19 +02:00
Duncan Beevers
ec62443b7c Deep equality check for collection membership 2014-01-29 19:08:16 -06:00
Jake Luer
df55ce919c Merge branch 'master' of github.com:chaijs/chai 2014-01-29 17:23:02 -05:00
Jake Luer
c3c1fccc2d assert: .throws() returns thrown error. Closes #185 2014-01-29 17:22:29 -05:00
Jake Luer
be23285a78 Merge pull request #232 from laconbass/assert-throws
Avoid error instantiation if possible on assert.throws
2014-01-29 13:28:47 -08:00
Jake Luer
b01eba75c9 assert: .fail() parameter mismatch. Closes #206 2014-01-29 16:23:04 -05:00
Veselin
a01e40b2cc Merge pull request #230 from jkroso/include
support `{a:1,b:2}.should.include({a:1})`
2014-01-27 07:11:45 -08:00
Veselin Todorov
3835bed2a6 Merge pull request #226 from duncanbeevers/add_has
Add `has` to language chains
2014-01-24 23:55:48 -08:00
laconbass
3741f0516d Avoid error instantiation if possible on assert.throws
Given an error constructor as function, try to get the error name from
its prototype or itself before relying on the old behaviour.

Closes #220

Replaces [the old pull](https://github.com/chaijs/chai/pull/221) to avoid
useless commits.
2014-01-15 18:49:16 +01:00
Duncan Beevers
ec3ccde264 Update Copyright notices to 2014 2014-01-05 20:03:42 -06:00
Jake Rosoman
acbf04dad2 handle negation correctly 2014-01-05 15:26:33 +13:00
Jake Rosoman
2715e95abc support {a:1,b:2}.should.include({a:1}) 2014-01-05 14:10:14 +13:00
Veselin Todorov
f3ebb09a58 Merge pull request #224 from vbardales/master
Return error on throw method to chain on error properties
2014-01-02 10:50:25 -08:00
Duncan Beevers
4ea26a7c61 Add has to language chains 2013-12-27 11:06:15 -06:00
Virginie BARDALES
2bb0ff2ab7 return error on throw method to chain on error properties, possibly different from message 2013-12-19 10:23:46 +01:00
Max Edmands
270f9d92d9 util: store chainable behavior in a __methods object on ctx 2013-12-01 09:55:01 -08:00
Max Edmands
76ac685d5a util: code style fix 2013-11-30 10:52:10 -08:00
Max Edmands
2127525933 util: add overwriteChainableMethod utility (for #215) 2013-11-30 09:31:06 -08:00
Andrei Neculau
d8529e4bf9 core: improve message for assertion errors (throw assertion) 2013-10-23 23:05:39 +02:00
Jake Luer
4b51ea7548 Release 1.8.1 2013-10-10 06:47:47 -04:00
Jake Luer
984622a4ea Release 1.8.0 2013-09-18 15:04:00 -04:00
Jake Luer
89c390fe36 util: remove embedded deep equal utility 2013-09-18 12:13:11 -04:00
Jake Luer
f1e7c574c6 util: replace embedded deep equal with external module 2013-09-18 12:11:37 -04:00
Ryunosuke SATO
68e71ab2a8 Fix highlight for example code
This fix is the same as #179.
2013-06-29 23:30:53 +09:00
Jake Luer
db4b9d7833 Release 1.7.2 2013-06-27 14:15:43 -04:00
Jake Luer
550c61e358 Merge pull request #180 from tricknotes/modify-method-title
Modify method title to include argument name
2013-06-27 09:59:44 -07:00
Ryunosuke SATO
4b10292274 Modify method title to include argument name 2013-06-27 18:56:24 +09:00
Ryunosuke SATO
ab91b501a5 Fix to highlight code example
The indent count for code example sould be 4 not 3.
2013-06-27 18:54:19 +09:00
Jake Luer
12467a6bfd Release 1.7.1 2013-06-24 14:46:03 -04:00
Jake Luer
c0f8e187a7 Release 1.7.0 2013-06-17 16:06:38 -04:00
Jake Luer
167d1a7193 error: remove internal assertion error constructor 2013-06-17 15:28:47 -04:00
Jake Luer
7bc580910e core: [assertion-error] replace internal assertion error with dep 2013-06-17 15:27:50 -04:00
Jake Luer
cfb6137054 docs: fix typo in source file. #174 2013-06-17 15:11:30 -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
Bartvds
774a723bff replaced tabs with 2 spaces 2013-06-09 01:31:26 +02:00
Bartvds
080702ac87 added assert.notOk() 2013-06-08 18:16:44 +02:00