Commit graph

436 commits

Author SHA1 Message Date
lucasfcosta
f286e0e6b3 Keys assertion can operate on Maps and Sets 2016-03-09 19:48:28 -03:00
lucasfcosta
10a0bbcc6a by assertion tests 2016-02-22 17:17:38 -03:00
Steven Peng
c3f3e94cc5 Convert keys to strings 2016-02-16 21:07:32 -08:00
lucasfcosta
e778cee15d Code style fixes related to function for value on inc, dec and changes 2016-02-11 18:56:29 -02:00
lucasfcosta
f158523321 Increases and Decreases assertions accepting function for value 2016-02-11 18:56:29 -02:00
lucasfcosta
0fe471885c Change accepts a function as object 2016-02-11 18:56:29 -02:00
qbolec
ae4b5f97c7 Added includeDeepMembers 2016-01-10 13:51:17 +01: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
Droogans
b474ceee54 feat(matchers): Allow for objects in oneOf 2015-10-15 15:02:43 -05:00
Droogans
179d4701b8 feat(matchers): Add value-in-list assertion
Adds a way to test if a value appears in a flat list. Compliments
`include.members` to reverse the order of the input. Now the list
appears in the assertion, as opposed to the `expect`.

Closes #532
2015-10-12 22:18:24 -05:00
root
7fe23e9799 Added approximately alias to close to 2015-10-04 01:49:25 -04:00
Jérémie Astori
1f8c65135d Remove multi-type support for a/an assertion 2015-09-12 13:04:56 +00:00
Jérémie Astori
675b51b3ad Add a utility to enforce allowed types tested by an assertion 2015-09-12 12:59:51 +00:00
Jérémie Astori
0acb2ec8f5 Use new feature of a/an assertion to check type of tested object when using include assertion 2015-09-12 10:14:01 +00:00
Jérémie Astori
d27ceb54a4 Improve message of multi-type a/an assertions 2015-09-12 10:14:01 +00:00
Jérémie Astori
5eb39067ad Add support of multiple types in an/a assertions for the BDD API, with naive message 2015-09-12 10:14:01 +00:00
Jérémie Astori
cf0e3a5677 Check that expected type for include is an array, an object, or a string, in a naive way 2015-09-12 10:14:01 +00:00
Keith Cirkel
cf9f5d99d7 Merge pull request #512 from dereke/master
fixed expect('').to.contain('') so it passes
2015-09-11 22:20:30 +01:00
kpdecker
b6b84e5631 Fix stack trace tracking for property asserts
The ssfi parameter was not being updated for these methods, which ended up causing the trace to be omitted.

Fixes #358
2015-09-08 02:15:47 -05:00
Derek Ekins
eaba0be444 fixed expect('').to.contain('') so it passes 2015-09-01 13:59:39 +01:00
Keith Cirkel
a42ac436bb Merge pull request #496 from astorije/astorije/frozen-errors
Make sure TypeErrors thrown by frozen are caught
2015-08-10 10:13:16 +01:00
Jérémie Astori
1cc56c88eb Remove some trailing whitespaces 2015-07-26 19:43:02 +00:00
Jérémie Astori
ffc59fccd5 Make sure TypeErrors thrown by extensible are treated in a ES6 way and test these 2015-07-26 19:42:46 +00:00
Jérémie Astori
9b71590fe3 Make sure TypeErrors thrown by sealed are treated in a ES6 way and test these 2015-07-26 19:31:48 +00:00
Jérémie Astori
eae67c0d5c Make sure TypeErrors thrown by frozen are treated in a ES6 way and test these 2015-07-26 17:43:48 +00:00
Wraithan (Chris McDonald)
3c681e2dce isAtLeast, isAtMost assertions added to assert interface 2015-07-24 09:25:56 -07:00
Cezary Kluczyński
5bd86c2b38 isNotTrue, isNotFalse assertions added 2015-07-20 19:29:04 +02:00
Jérémie Astori
3be31001d1 Add tests for throws aliases 2015-07-18 23:14:45 +00:00
Jérémie Astori
11aa743472 Add aliases (and tests) for assert.ok and assert.notOk to match the other isSomething assertions 2015-07-18 23:14:45 +00:00
Jérémie Astori
40dc848842 Add tests for frozen, sealed and extensible aliases 2015-07-18 23:08:12 +00:00
Brad Cypert
a5687a2648 Added support for NaN. Tests included. 2015-07-16 10:18:54 -07:00
matthewlucock
63a89f6967 Assertions to test if objects are frozen 2015-07-12 22:57:42 +10:00
matthewlucock
1486d41b96 Assertions to test if objects are sealed 2015-07-12 22:57:26 +10:00
matthewlucock
4c7926f5f0 Assertions to test if objects are extensible 2015-07-12 22:56:15 +10:00
root
3048c06f00 Assert ifError now throws the error passed in, to keep it consistent with node's assert.ifError 2015-05-29 20:37:29 +01:00
Keith Cirkel
57a5bfd6f2 Merge pull request #451 from csnover/browserify
Switch to use Browserify for builds
2015-05-29 20:17:14 +01:00
⅕ Zander
91f57e9598 Add tests for undefined property error 2015-05-29 02:16:22 -04:00
Colin Snover
afc8aa1d50 Switch to use Browserify for builds
Fixes #362.
2015-05-27 13:04:16 +00:00
James Kyle
f1572d64d2 Add Assertion alias: matches => match. Resolves #438 2015-05-04 08:50:34 -07:00
Jordan Harband
517d46392f Use a regex to account for property ordering issues across engines. 2015-04-07 09:16:10 -07:00
Jordan Harband
8b6a3ccb31 Add ownPropertyDescriptor assertion. 2015-03-26 14:08:53 -07: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
Kaito Udagawa
b6e1b573e0 Escaping dot should be taken in deep property
* removing backslash prior to "."
* test case: "foo\\.bar" names {"foo.bar": "baz"}
2015-03-17 19:39:14 +09:00
root
da2ec4a1d4 No longer using eval on assert operator #386 2015-03-08 13:18:49 -04:00
eldritch fossicker
57ef36621f fix indexing into array with deep propery
* added unit test to expect with code from documentation
* added default to res in _getPathValue
2015-03-02 14:00:46 -06:00
Keith Cirkel
9b25d0c524 Merge pull request #356 from Soviut/master
Added fail() method to Should and Expect interfaces
2015-02-10 23:41:58 +00:00
Ian Zamojc
c2f9e430d9 fail method added directly to expect 2015-02-10 16:50:31 -05:00
Gregg Lind
4f40b37356 fix #359. Add `.keys(object)
- `.keys(object)n => .keys(Object.keys(Object)`
- added exceptions for 'if first arg is non-string, then it must be only
arg.  => `.keys(Array|Object, ...)`

Warning:  `Object.keys` must exist on systems to use this functionality.
2015-02-09 09:16:01 -06:00
Gregg Lind
68f3c02f07 Fix #359 keys() sorts input unexpectedly 2015-02-05 19:36:09 -06:00
Ian Zamojc
61d8718c69 added fail() method to expect interface 2015-01-30 16:00:47 -05:00
Ian Zamojc
9080562c9a using proper error checking method for should 2015-01-30 16:00:47 -05:00
Ian Zamojc
d353bf7bc5 added should.fail() method 2015-01-30 16:00:46 -05:00
toastynerd
498fe95126 add the which chain method as per issue #347 2015-01-22 09:07:59 -08:00
Chris Polis
051fd95d88 cleaned out .by for #333 2015-01-02 10:13:44 -08:00
Chris Polis
cb1c33b5d8 updated change to work w/ non-number values + tests 2014-12-29 09:45:25 -08:00
Chris Polis
be67119616 assert tests for change,increase,decrease 2014-12-27 17:13:22 -08:00
Chris Polis
c44a5133f9 expect/should tests for change,increase,decrease 2014-12-27 17:10:59 -08: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
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
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
Joshua Perry
8cdb7b1d76 Refactor if statement out 2014-11-18 17:42:30 -07:00
Joshua Perry
c4b0d18829 Small unit test fix 2014-11-18 17:25:39 -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
Keith Cirkel
828f48148f Merge pull request #297 from prodatakey/noopchainfunc
Allows writing lint-friendly tests
2014-11-10 09:44:19 +00:00
Julien Wajsberg
84cba222d1 Fix #299: the test is defining global variables 2014-11-06 12:09:55 +01:00
Joshua Perry
867563b0db Add a couple more unit tests 2014-11-05 10:14:28 -07:00
Joshua Perry
b4c0424ffb Add unit tests for chained terminating property asserts 2014-11-05 07:30:45 -07: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
Joshua Perry
cc1357d344 Change test to not trigger argument bug 2014-10-13 18:00:07 -06: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
834fd5b0dd Merge pull request #268 from charlierudolph/cr-lazyMessages
Allow messages to be functions
2014-09-29 18:18:25 -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
Christopher Hiller
6d6f03d2d2 resolves #255: upgrade mocha 2014-09-11 22:54:56 -07:00
mohayonao
11fe70ef82 assert: .closeTo() verify value's type before assertion 2014-07-16 09:50:45 +09:00
charlierudolph
216ad26aa1 Allow messages to be functions 2014-06-08 14:00:42 -07:00
Jake Luer
1df11d0027 util: [getActual] select actual logic now allows undefined for actual. Closes #183 2014-03-18 09:35:43 -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
leider
cb910afc52 additional test finds incomplete implementation 2014-02-09 14:41:03 +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
c3c1fccc2d assert: .throws() returns thrown error. Closes #185 2014-01-29 17:22:29 -05: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
764d00e73c Remove jscoverage 2014-01-26 08:38:49 +02:00
Jake Rosoman
acbf04dad2 handle negation correctly 2014-01-05 15:26:33 +13:00
Jake Rosoman
75bb2b68f6 add failing test case 2014-01-05 14:33:52 +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
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
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
Andrei Neculau
b1c7d710a4 test: add tests for throwing custom errors 2013-10-23 23:48:48 +02:00
Andrei Neculau
e174212d0f test: updated for the new assertion errors 2013-10-23 23:06:39 +02:00
Jake Luer
8a2e00b486 test: [sauce] use karma@canary to prevent timeouts 2013-09-17 23:12:16 -04: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
Jake Luer
7bc580910e core: [assertion-error] replace internal assertion error with dep 2013-06-17 15:27:50 -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
George Kats
044dcff68d Fix comparison objects.
Regexp and Date objects can to be deep equal to objects with the same type.
2013-06-06 00:53:34 +03:00
George Kats
2c4da4a91a Add test for different RegExp flags. 2013-06-05 23:26:42 +03:00
George Kats
f62eb19a66 Add test for regexp comparison. 2013-06-05 02:14:53 +03:00
Jake Luer
019bb07637 assert: [(not)include] throw on incompatible haystack. Closes #142 2013-04-29 19:30:51 -04:00
Jake Luer
8f8d7425a5 assert: [notInclude] add assert.notInclude. Closes #158 2013-04-29 19:03:53 -04:00
Jake Luer
30784962da Merge branch 'master' of github.com:chaijs/chai
* 'master' of github.com:chaijs/chai:
  giving members a no-flag assertion
  Code review comments - changing syntax
  Code review comments
  Adding members and memberEquals assertions for checking for subsets and set equality. Implements chaijs/chai#148.
  Restore the `call` and `apply` methods of Function when adding a chainable method.
2013-04-29 17:18:34 -04:00
Jake Luer
e5e3a4fa42 test: [assert] deep equal ordering 2013-04-29 17:18:22 -04:00
Nick Heiner
244fa51336 giving members a no-flag assertion 2013-04-23 11:12:23 -04:00
Nick Heiner
22e2a78a4e Code review comments - changing syntax 2013-04-14 19:07:12 -04:00
Nick Heiner
078da00be3 Adding members and memberEquals assertions for checking for subsets and set equality. Implements chaijs/chai#148. 2013-04-14 17:58:07 -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
4db0b20c57 test: for ever err() there must be a passing version 2013-02-04 19:28:26 -05:00
Jake Luer
6ccbd03780 tests: refactor some tests to support new objDisplay output 2013-02-03 18:03:40 -05:00
Jake Luer
364939ef15 test: [bootstrap] normalize boostrap across all test scenarios 2013-02-03 18:03:15 -05:00
Jake Luer
8ae89cd72d test: [expect] add arguments type detection test 2013-02-03 15:12:29 -05:00
Jake Luer
398964d75b test: add mochaPhantomJS support and component test file 2013-02-03 14:40:50 -05:00
Jake Luer
ff9005caa8 Merge branch 'feature/showDiff'
* feature/showDiff:
  test: [Assertion] configruable showDiff flag. Closes #132
  lib: [Assertion] add configurable showDiff flag. #132
  showDiff: force true for equal and eql

Conflicts:
	lib/chai/assertion.js
	test/display/message.js
2013-02-03 13:27:38 -05:00
Jake Luer
3e8e9dea49 test: [Assertion] configruable showDiff flag. Closes #132 2013-02-03 13:25:55 -05:00
Jake Luer
30b48bd4c5 Merge branch 'master' into feature/saucelabs
* master:
  Fix issue #137, test message existence by using message!=null rather than using message
  Fixed backwards negation messages.
2013-02-03 13:00:16 -05:00
Jake Luer
87b0a44ecc support: add mocha cloud runner, client, and html test page 2013-02-03 12:59:15 -05:00
Jake Luer
654bb8f90b test: [saucelabs] add auth placeholder 2013-02-03 12:57:25 -05:00
Jake Luer
e619f98999 Merge pull request #136 from whatthejeff/message_fix
Fixed backwards negation messages.
2013-02-02 16:06:19 -08:00
DD
91d2805393 Fix issue #137, test message existence by using message!=null rather than using message 2013-02-03 00:49:48 +08:00
Jeff Welch
4033c14f01 Fixed backwards negation messages. 2013-02-01 23:12:01 -05:00
Ruben Verborgh
9bcc5e7f08 Functions throwing strings can reliably be tested. 2013-01-27 20:11:50 +01:00
Domenic Denicola
0fe68b021c Use inherited enumerable properties in deep equality comparison.
Fixes #120.
2012-12-30 06:26:26 -05:00
Domenic Denicola
730a12baa6 Show inherited properties when inspecting an object. 2012-12-30 06:25:17 -05:00
Jake Luer
4582d700b0 test: [display] array test for mocha object diff 2012-12-21 15:01:15 -05:00
Jake Luer
3aa71e77cf test: [expect] type null. #122 2012-12-15 15:08:30 -05:00
Edwin Shao
f438d37e44 TST: assert.Throw should check error type/message
Currently, assert.Throw will not take into account the expected
error type or message passed in. Write tests to document this.
2012-11-30 19:37:12 +08:00
Jake Luer
86fe576d56 convert tests to use new bootstrap 2012-11-29 03:18:48 -05:00
Jake Luer
5e07b04fdb refactor testing bootstrap 2012-11-29 03:18:25 -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
Chris Connelly
3d05feee32 Added support for circular references when checking deep (in)equality. 2012-10-21 22:15:49 +01:00
Jake Luer
d9758753a2 add back buffer test for deep equal 2012-10-01 16:14:32 -04:00
Jake Luer
ac52bd12b3 do not write flags to assertion.prototype 2012-10-01 16:13:57 -04:00
Jake Luer
a2e8d2ce0f remove buffer test from expect 2012-10-01 15:31:54 -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
d6bbc5fddd expect tests now include message pass-through 2012-09-05 11:13:14 -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
e8cc23ddd9 Make globalShould test work in browser too.
Needed to move `should` from test/should.js out of the global scope.
2012-08-24 22:33:47 -04:00
Domenic Denicola
1024e2dd14 Add a setter for Object.prototype.should. Closes #86. 2012-08-24 20:28:13 -04:00
Jake Luer
429cb6d5a6 add display sample for error message refactor 2012-08-01 21:12:49 -04:00
Jake Luer
19fe54399b add closeTo assertion to assert interface. Closes #89. 2012-08-01 20:21:52 -04:00
Victor Costan
f269726e9c Don't inspect() assertion arguments if the assertion passes. 2012-07-19 02:09:14 -07:00
Domenic Denicola
61db4e05c6 Disable "Assertion.includeStack is false" test in IE.
This only manifested in IE 10; IE 9 was fine since it didn't have the `stack` property.
2012-06-26 12:35:41 -04:00
Kilian Ciuffolo
da2bbbf666 fixes #79 2012-06-26 13:41:15 +02:00
Jake Luer
7629f8c4e5 tests for length as chainable property. #74 2012-06-24 08:46:44 -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
Benjamin Horsleben
80aa590ec5 Added itself chain. 2012-06-02 19:27:55 +02: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
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