Commit graph

121 commits

Author SHA1 Message Date
meeber
e380173aed Fix bug when testing Symbol equality with should syntax (#669) 2016-04-08 06:17:30 -04:00
Homa Wong
384f88c3f6 Merge branch 'master' into patch-1 2016-03-27 16:34:11 -07:00
Homa Wong
7e026ad170 Update expect.js
The err() takes only two params
2016-03-26 23:14:28 -07:00
lucasfcosta
c654360e68 Keys assertions on assert interface (and tests) 2016-03-09 19:48:28 -03:00
lucasfcosta
1b308587b0 Tests for keys assertion on maps and sets 2016-03-09 19:48:28 -03:00
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
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
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
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
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