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
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
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
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
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
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
mohayonao
11fe70ef82
assert: .closeTo() verify value's type before assertion
2014-07-16 09:50:45 +09:00
Jake Luer
1df11d0027
util: [getActual] select actual logic now allows undefined for actual. Closes #183
2014-03-18 09:35:43 -04: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
Duncan Beevers
ec62443b7c
Deep equality check for collection membership
2014-01-29 19:08:16 -06: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
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
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
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
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
Jake Luer
6ccbd03780
tests: refactor some tests to support new objDisplay output
2013-02-03 18:03:40 -05:00
Jake Luer
8ae89cd72d
test: [expect] add arguments type detection test
2013-02-03 15:12:29 -05:00
Jeff Welch
4033c14f01
Fixed backwards negation messages.
2013-02-01 23:12:01 -05:00
Domenic Denicola
730a12baa6
Show inherited properties when inspecting an object.
2012-12-30 06:25:17 -05:00
Jake Luer
3aa71e77cf
test: [expect] type null. #122
2012-12-15 15:08:30 -05:00
Jake Luer
86fe576d56
convert tests to use new bootstrap
2012-11-29 03:18:48 -05: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