Jake Luer
220aa88386
use spaces (not tabs). Clean up #114
2012-11-29 03:17:26 -05:00
Jake Luer
d6d41a5259
Merge pull request #114 from trantorLiu/master
...
Add most() and least() to the API
2012-11-28 23:05:19 -08:00
Chun-Yi
0422f071a4
Add most() (alias: lte) and least() (alias: gte) to the API with new chainers "at" and "of".
...
The new chainers can be used with least() and most().
Examples:
expect(5).to.be.at.least(5);
(5).should.be.at.most(5);
expect([1, 2]).to.have.length.of.at.least(2);
2012-11-29 11:55:57 +08:00
Jake Luer
0ce651c776
Merge pull request #104 from connec/deep_equals_circular_references
...
Added support (and tests) for circular references when checking deep (in)equality.
2012-11-18 10:09:47 -08:00
Niklas Närhinen
24d4991194
Check for 'actual' type
...
At least on Node.js actual property isn't correctly populated because of strict string comparison.
2012-11-16 09:50:30 +02:00
Chris Connelly
3d05feee32
Added support for circular references when checking deep (in)equality.
2012-10-21 22:15:49 +01:00
Jake Luer
8788025362
Release 1.3.0
2012-10-01 17:32:20 -04:00
Jake Luer
beeeac2da5
improve documentation of custom error messages
2012-10-01 15:13:34 -04:00
Jake Luer
ca18882362
Merge branch 'master' of git://github.com/Liffft/chai into Liffft-master
...
* 'master' of git://github.com/Liffft/chai:
Cleaning up the js style…
expect tests now include message pass-through
packaging up browser-side changes…
Increasing Throws error message verbosity
Should syntax: piping message through
Conflicts:
test/expect.js
2012-10-01 15:06:24 -04:00
Jake Luer
9dd85eabd3
improved buffer deep equal checking
2012-10-01 14:47:21 -04:00
Scott Nonnenberg
00b2ed3840
Cleaning up the js style…
...
I've been writing too much coffeescript!
2012-09-05 11:24:27 -07:00
Scott Nonnenberg
941f992a26
Increasing Throws error message verbosity
...
'cause we actually want to know what was thrown.
2012-09-04 23:13:44 -07:00
Scott Nonnenberg
e383a6ece8
Should syntax: piping message through
2012-09-04 23:10:25 -07:00
Domenic Denicola
1024e2dd14
Add a setter for Object.prototype.should
. Closes #86 .
2012-08-24 20:28:13 -04:00
Jake Luer
35bec1b896
Release 1.2.0
2012-08-07 01:05:25 -04:00
Jake Luer
a83c7772e0
comment updates for utilities
2012-08-07 00:57:59 -04:00
Jake Luer
7ce5e9347e
tweak objDislay to only kick in if object inspection is too long
2012-08-07 00:57:38 -04:00
Jake Luer
dc6c5533eb
first draft of error message refactor. #93
2012-08-01 21:05:25 -04:00
Jake Luer
19fe54399b
add closeTo
assertion to assert
interface. Closes #89 .
2012-08-01 20:21:52 -04:00
Paul Miller
6b66ce72dd
Add check for DOM objects.
2012-07-28 03:27:38 +03:00
Jake Luer
e6d69c36e4
Merge branch 'master' of github.com:chaijs/chai
2012-07-26 14:12:23 -04:00
Jake Luer
4e3c89a14d
bug - getActual not defaulting to assertion subject
2012-07-26 14:11:43 -04:00
Victor Costan
f269726e9c
Don't inspect() assertion arguments if the assertion passes.
2012-07-19 02:09:14 -07:00
Jake Luer
b7aae4601f
Release 1.1.1
2012-07-09 12:49:18 -04:00
Teddy Cross
ddfea9575b
Document .equals
...
Not sure why it decided to move error.js around. Oh well?
2012-07-07 14:47:28 -04:00
Teddy Cross
45e458067a
Add .equals as an alias of .equal
2012-07-07 13:49:18 -04:00
Jake Luer
456ee6ad83
Release 1.1.0
2012-06-26 14:32:49 -04:00
Domenic Denicola
79c3654691
Use utils.getName
for all function inspections.
...
This makes the `respondTo` tests pass in IE, where functions don't themselves have a `name` property.
2012-06-26 12:30:25 -04:00
Kilian Ciuffolo
da2bbbf666
fixes #79
2012-06-26 13:41:15 +02:00
Jake Luer
c85882691f
expand docs to indicate change of subject for chaining. Closes #78
2012-06-24 09:14:15 -04:00
Jake Luer
94cfe27c4c
add that
chain noop
2012-06-24 08:57:40 -04:00
Jake Luer
723dbdfe98
comments on how to property use length
as chain. Closes #74
2012-06-24 08:54:56 -04:00
Jake Luer
0da5c375ce
add support for length
as chainable prop/method.
...
property can chain to above, below, within
`expect('foo').to.have.length.above(2);`
`expect('foo').to.have.length.below(4);`
`expect('foo').to.have.length.within(2,4);`
2012-06-24 08:44:14 -04:00
Jake Luer
cf1bac542e
add getPathValue support for nested arrays
2012-06-24 08:19:01 -04:00
Jake Luer
802856849b
fix bug for missing browser utils
2012-06-24 07:43:50 -04:00
Jake Luer
cc0367a46a
move core assertions to own file and refactor all using utils
...
* all properties are now defined using `Assertion.addProperty`
* all methods are now defined using `Assertion.addMethod`
2012-06-24 07:06:26 -04:00
Jake Luer
ff8455f303
rearrange folder structure
2012-06-24 06:25:36 -04:00
Jake Luer
40b0eb2268
Release 1.0.4
2012-06-03 19:29:39 -04:00
Benjamin Horsleben
80aa590ec5
Added itself chain.
2012-06-02 19:27:55 +02:00
Jake Luer
a05cba500c
simplify error inspections for cross browser compatibility
2012-05-29 13:28:41 -04:00
Jake Luer
d02e94adff
fix safari addChainableMethod
errors. Closes #69
...
- also added arguments alias to `Arguments`.
- note: one can also call `expect(arguments).to.be.an('arguments')`
2012-05-29 13:07:00 -04:00
Jake Luer
886e626e57
Release 1.0.3
2012-05-27 18:19:47 -04:00
domenic
8cd580d7f2
Make error message for eql/deep.equal more clear.
2012-05-27 17:34:27 -04:00
domenic
db98bd69e6
Fix .not.deep.equal.
...
It wasn't passing the negation through.
2012-05-27 17:31:06 -04:00
Jake Luer
1b89af7114
Release 1.0.2
2012-05-26 23:39:29 -04:00
domenic
e1256e9005
Use addChainableMethod
to get away from __proto__
manipulation.
...
Helps with #66 .
2012-05-26 22:38:47 -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
ffab05a192
utility - get all flags
2012-05-22 14:51:39 -04:00
Jake Luer
ca5368cf65
Release 1.0.1
2012-05-18 14:26:45 -04:00
domenic
554944f82f
Fixing "an" vs. "a" grammar in type assertions.
...
Now says stuff like "expected x to be an array" instead of "expected x to be a array."
2012-05-18 14:05:06 -04:00
domenic
46a2f1c406
Uniformize assert
interface inline docs.
...
At the same time, made small tweaks to the should/expect ones.
2012-05-18 14:00:50 -04:00
domenic
ae3be8c684
Don't use instanceof
for assert.isArray
.
...
This makes it more compatible with cross-frame checks.
2012-05-18 14:00:46 -04:00
domenic
4a938ef672
Add deep
flag for equality and property value.
...
See #63 for more discussion.
Also adds to the assert interface:
- deepProperty
- notDeepProperty
- deepPropertyVal
- deepPropertyNotVal
2012-05-17 10:13:19 -04:00
domenic
771895aab8
Uniformize assertion inline docs.
2012-05-16 20:55:36 -04:00
Jake Luer
efc7759633
no reserved words as actuals. #62
2012-05-16 19:01:36 -04:00
Jake Luer
ec07b48ed0
Release 1.0.0
2012-05-15 14:36:29 -04:00
Jake Luer
a8d1404b2f
browser build
2012-05-15 13:23:32 -04:00
Jake Luer
6114afc906
utility comments
2012-05-15 13:20:24 -04:00
Jake Luer
9c63add86e
comments / docs updates
2012-05-14 20:32:53 -04:00
Jo Liss
4b72ff65ca
Fix and improve documentation of assert.equal and friends
2012-05-14 15:01:57 +02:00
John Firebaugh
ce5fc298ab
Use defined return value of Assertion extension functions
2012-05-09 19:22:25 -07:00
John Firebaugh
4122ae5db9
Update utility docs
2012-05-09 19:01:22 -07:00
Jake Luer
be7a8fcf48
Release 1.0.0-rc3
2012-05-09 19:20:56 -04:00
Jake Luer
666e75cfd6
assert minor refactor
...
- assert is now a function
- length is now lengthOf
- ownProperty derivatives done have `own` keyword
2012-05-09 19:16:26 -04:00
Jake Luer
9bacec225b
added chai.Assertion.add/overwrite prop/method for plugin toolbox
2012-05-09 18:56:53 -04:00
Jake Luer
7fe1f31ad9
add/overwrite prop/method don't make assumptions about context
2012-05-09 18:56:15 -04:00
Jake Luer
4a4966d94d
refactor all simple chains into one forEach loop, for clean documentation
2012-05-09 17:22:53 -04:00
Jake Luer
8cec45ac8a
comment updates for docs
2012-05-09 12:12:34 -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
Domenic Denicola
942c5b98d1
return this
not necessary in example.
2012-05-07 17:26:27 -03:00
Domenic Denicola
8df3b13fe8
return this
not necessary in example.
2012-05-07 17:24:06 -03:00
Jake Luer
0e2c11a4ab
Release 1.0.0-rc2
2012-05-06 07:29:20 -04:00
Jake Luer
bed8867ac0
appropriate assert equivalent for expect.to.have.property(key, val)
2012-05-06 07:22:07 -04:00
Jake Luer
d03d686330
reset AssertionError to include full stack
2012-05-06 07:01:34 -04:00
Jake Luer
9105b89fc9
overwrite Property and Method now ensure chain
2012-05-06 06:54:21 -04:00
Jake Luer
0ecbc0eab2
Release 1.0.0-rc1
2012-05-04 17:58:24 -04:00
Jake Luer
97296e4979
assert interface - notMatch, ownProperty, notOwnProperty, ownPropertyVal, ownPropertyNotVal
2012-05-04 17:55:11 -04:00
Jake Luer
1082fc6544
cleaner should interface export.
...
- also aliased `chai.Should()` as the original would be overwritten after the first call (helps when using watch mode for test runners)
2012-05-04 17:55:11 -04:00
Jake Luer
755a36938b
added chai.Assertion.prototype._obj (getter) for quick access to object flag
2012-05-04 17:55:11 -04:00
Jake Luer
0a8ddc452f
moved almostEqual / almostDeepEqual to stats plugin
2012-05-04 17:55:11 -04:00
Veselin Todorov
22f594a0b9
Fix a typo
2012-04-29 10:21:33 +03:00
Veselin Todorov
f58760c615
Add undefined assertion
2012-04-29 09:59:24 +03:00
Veselin Todorov
234f4ee613
Add null assertion
2012-04-29 09:59:14 +03:00
Jake Luer
ee2050abaa
Merge pull request #54 from josher19/master
...
Added almostEqual to assert test suite.
2012-04-23 21:07:36 -07:00
josher19
d2f80f5991
Remove old test.assert code
2012-04-24 11:44:16 +08:00
josher19
d5fe1839a0
Use util.inspect instead of inspect for deepAlmostEqual and almostEqual
2012-04-24 11:34:59 +08:00
Jake Luer
ed14ab04c9
bug - context determinants for utils
2012-04-23 01:40:28 -04:00
josher19
6702b4da3d
dec=0 means rounding, so assert.deepAlmostEqual({pi: 3.1416}, {pi: 3}, 0) is true
2012-04-23 13:36:12 +08:00
Jake Luer
6292957d5e
[bug] util addProperty
not correctly exporting
2012-04-22 18:22:12 -04:00
Jake Luer
df069ad2d1
not using reserved words in internal assertions. #52
...
This commit fixes #52 in 1.0.0+
- also added mt/lt alias
2012-04-22 17:03:48 -04:00
Jake Luer
fc4956e9fa
version tick
2012-04-22 16:54:21 -04:00
Jake Luer
2d49079f60
Merge branch 'refs/heads/0.6.x'
...
Conflicts:
chai.js
docs/out/chai.js
docs/out/code/assert.html
docs/out/code/expect.html
docs/out/index.html
docs/out/support/coverage/index.html
docs/out/support/tests/mocha.js
lib/assertion.js
lib/chai.js
lib/error.js
lib/interface/assert.js
package.json
2012-04-22 16:39:54 -04:00
Jake Luer
b009feb48f
updated utility comments
2012-04-22 15:26:15 -04:00
Jake Luer
c49ef2790d
utility - overwriteMethod
2012-04-22 14:46:34 -04:00
Jake Luer
f7fd4ea282
utility - overwriteProperty
2012-04-22 14:46:26 -04:00
Jake Luer
f790baa32b
utility - addMethod
2012-04-22 14:46:12 -04:00
Jake Luer
76b195cd6c
utility - addProperty
2012-04-22 14:46:03 -04:00
Jake Luer
31e3035c3d
missing ;
2012-04-22 14:44:52 -04:00