Commit graph

122 commits

Author SHA1 Message Date
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
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
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
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
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
John Firebaugh
ce5fc298ab Use defined return value of Assertion extension functions 2012-05-09 19:22:25 -07:00
Jake Luer
d49436ccc9 assert test conformity for minor refactor api 2012-05-09 19:16:42 -04:00
Jake Luer
1bb600e996 update util tests for new add/overwrite prop/method format 2012-05-09 18:57:14 -04:00
Jake Luer
626d11efb4 doc test suite 2012-05-09 18:43:01 -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
aa3d84aab6 missing assert tests for ownProperty 2012-05-06 07:22:29 -04:00
Jake Luer
d03d686330 reset AssertionError to include full stack 2012-05-06 07:01:34 -04:00
Jake Luer
4a05659fa0 test for plugin utilities 2012-05-06 06:54:32 -04:00
Jake Luer
943b7569bd assert match/notMatch tests 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
0a8ddc452f moved almostEqual / almostDeepEqual to stats plugin 2012-05-04 17:55:11 -04:00
Jake Luer
f596097e7b added mocha.opts
(so @domenic can run tests without the makefile)
2012-05-04 17:55:11 -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
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
Veselin Todorov
930dfbdc4f Fix an issue with mocha --watch
When running tests with `mocha --watch` the following exception is thrown:

  TypeError: Cannot redefine property: testing

Here is the fix for it. We should be more careful in the future, since the `watch` param is super useful and a lot of developers are using it.
2012-04-29 09:58:56 +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
19c1fb1b9c Added almostEqual and deepAlmostEqual to assert test suite. 2012-04-23 13:56:44 +08:00
Jake Luer
87870b1b9d clean up redundant tests 2012-04-22 16:54:11 -04:00
Jake Luer
88c121e5ee added utility tests to browser specs 2012-04-22 15:26:54 -04:00
Jake Luer
c8c780aa35 beginning utility testing 2012-04-22 15:26:45 -04:00
Veselin Todorov
4a8b41e268 Include/contain are now both properties and methods 2012-04-20 20:44:23 +03:00
domenic
4227b80d3a Fixing order of error message test.
It was saying "expected <expected> to equal <actual>," which is backwards, and very confusing.
2012-04-15 15:14:43 -04:00
domenic
e7d89e24dd Add doctypes 2012-04-15 14:27:01 -04:00
Jake Luer
d171238026 [refactor] all usage of Assertion.prototype.assert now uses template tags and flags 2012-04-11 13:30:40 -04:00
domenic
41f645dbb8 Added support for throw(errorInstance).
Closes #47.
2012-04-09 00:34:02 -04:00
domenic
f58f1ebb12 Use a foolproof method of grabbing an error's name.
Closes #45.
2012-04-09 00:34:01 -04:00
domenic
48eeb56a75 Removed constructor.name check from throw.
Closes #46 and helps with #45.
2012-04-09 00:34:01 -04:00
Jake Luer
9d302aa435 disabled stackTrack configuration tests until api is stable again 2012-04-06 21:17:43 -04:00
Jake Luer
850509a73a first version of line displayed error for node js (unstable)
must have `chai.Assertion.includeStack = true`
2012-04-06 21:15:54 -04:00
Jake Luer
a7c262523c tests for assert interface negatives. Closed #42 2012-04-06 19:57:45 -04:00
Jake Luer
938c064d5f Added assert.fail. Closes #40 2012-03-21 07:17:51 -04:00
Jake Luer
1abf9cfc8c better error message for assert.operator. Closes #39 2012-03-21 07:17:39 -04:00
Jake Luer
7890dc6aa6 chai.fail no longer exists 2012-03-14 16:52:41 -04:00
Jake Luer
bacfc3d799 Added asset#isDefined. Closes #37. 2012-03-14 16:51:21 -04:00
Jake Luer
9ab32d7757 Merge branch 'bug/33-throws' 2012-03-07 11:42:50 -05:00
Jake Luer
09c970feaa Assertion#throw should tests updated 2012-03-07 11:38:58 -05:00
Jake Luer
7bb24c874e Assertion#throw expect tests 2012-03-07 11:37:23 -05:00