chai 1.9.2 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/History.md +20 -0
- package/README.md +23 -13
- package/ReleaseNotes.md +80 -0
- package/bower.json +1 -1
- package/chai.js +254 -258
- package/lib/chai/assertion.js +5 -0
- package/lib/chai/core/assertions.js +43 -9
- package/lib/chai/utils/inspect.js +3 -0
- package/lib/chai.js +1 -1
- package/package.json +1 -1
package/History.md
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
|
|
2
|
+
1.10.0 / 2014-11-10
|
|
3
|
+
==================
|
|
4
|
+
|
|
5
|
+
* Merge pull request #297 from prodatakey/noopchainfunc
|
|
6
|
+
* Merge pull request #300 from julienw/299-fix-getMessage-test
|
|
7
|
+
* Fix #299: the test is defining global variables
|
|
8
|
+
* Add a couple more unit tests
|
|
9
|
+
* Add unit tests for chained terminating property asserts
|
|
10
|
+
* Revise documentation wording
|
|
11
|
+
* Add docs for function style NOOP asserts
|
|
12
|
+
* Make the NOOP function a shared constant
|
|
13
|
+
* Merge pull request #298 from dasilvacontin/negativeZeroLogging
|
|
14
|
+
* why not more assertions
|
|
15
|
+
* added test for inspecting `-0`
|
|
16
|
+
* a more readable/simple condition statement, as pointed out by @keithamus
|
|
17
|
+
* added check for logging negative zero
|
|
18
|
+
* Change test to not trigger argument bug
|
|
19
|
+
* Allows writing lint-friendly tests
|
|
20
|
+
* readme: update contributors for 1.9.2
|
|
21
|
+
|
|
2
22
|
1.9.2 / 2014-09-29
|
|
3
23
|
==================
|
|
4
24
|
|
package/README.md
CHANGED
|
@@ -24,31 +24,34 @@ Chai offers a robust Plugin architecture for extending Chai's assertions and int
|
|
|
24
24
|
|
|
25
25
|
### Contributors
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
commits :
|
|
30
|
-
active : 170 days
|
|
27
|
+
repo age : 2 years, 11 months
|
|
28
|
+
active : 189 days
|
|
29
|
+
commits : 792
|
|
31
30
|
files : 57
|
|
32
31
|
authors :
|
|
33
|
-
|
|
34
|
-
79 Veselin Todorov 10.
|
|
35
|
-
43 Domenic Denicola 5.
|
|
32
|
+
551 Jake Luer 69.6%
|
|
33
|
+
79 Veselin Todorov 10.0%
|
|
34
|
+
43 Domenic Denicola 5.4%
|
|
35
|
+
7 Joshua Perry 0.9%
|
|
36
36
|
6 Ruben Verborgh 0.8%
|
|
37
|
-
5 George Kats 0.
|
|
38
|
-
5 Jo Liss 0.
|
|
39
|
-
5 Juliusz Gonera 0.
|
|
40
|
-
5 Scott Nonnenberg 0.
|
|
41
|
-
5 leider 0.
|
|
37
|
+
5 George Kats 0.6%
|
|
38
|
+
5 Jo Liss 0.6%
|
|
39
|
+
5 Juliusz Gonera 0.6%
|
|
40
|
+
5 Scott Nonnenberg 0.6%
|
|
41
|
+
5 leider 0.6%
|
|
42
|
+
4 David da Silva 0.5%
|
|
42
43
|
4 John Firebaugh 0.5%
|
|
43
44
|
4 Max Edmands 0.5%
|
|
44
45
|
4 Nick Heiner 0.5%
|
|
46
|
+
4 Veselin 0.5%
|
|
47
|
+
4 charlierudolph 0.5%
|
|
45
48
|
4 josher19 0.5%
|
|
46
49
|
3 Andrei Neculau 0.4%
|
|
47
50
|
3 Duncan Beevers 0.4%
|
|
48
51
|
3 Jake Rosoman 0.4%
|
|
49
52
|
3 Jeff Barczewski 0.4%
|
|
53
|
+
3 Keith Cirkel 0.4%
|
|
50
54
|
3 Ryunosuke SATO 0.4%
|
|
51
|
-
3 Veselin 0.4%
|
|
52
55
|
2 Bartvds 0.3%
|
|
53
56
|
2 Edwin Shao 0.3%
|
|
54
57
|
2 Jakub Nešetřil 0.3%
|
|
@@ -58,12 +61,16 @@ Chai offers a robust Plugin architecture for extending Chai's assertions and int
|
|
|
58
61
|
1 Benjamin Horsleben 0.1%
|
|
59
62
|
1 Brandon Payton 0.1%
|
|
60
63
|
1 Chris Connelly 0.1%
|
|
64
|
+
1 Chris Thompson 0.1%
|
|
65
|
+
1 Christopher Hiller 0.1%
|
|
61
66
|
1 Chun-Yi 0.1%
|
|
62
67
|
1 DD 0.1%
|
|
63
68
|
1 Dido Arellano 0.1%
|
|
64
69
|
1 Jeff Welch 0.1%
|
|
70
|
+
1 Julien Wajsberg 0.1%
|
|
65
71
|
1 Kilian Ciuffolo 0.1%
|
|
66
72
|
1 Luís Cardoso 0.1%
|
|
73
|
+
1 Martin Middel 0.1%
|
|
67
74
|
1 Niklas Närhinen 0.1%
|
|
68
75
|
1 Paul Miller 0.1%
|
|
69
76
|
1 Refael Ackermann 0.1%
|
|
@@ -72,7 +79,10 @@ Chai offers a robust Plugin architecture for extending Chai's assertions and int
|
|
|
72
79
|
1 Vinay Pulim 0.1%
|
|
73
80
|
1 Virginie BARDALES 0.1%
|
|
74
81
|
1 laconbass 0.1%
|
|
82
|
+
1 mohayonao 0.1%
|
|
75
83
|
1 piecioshka 0.1%
|
|
84
|
+
1 shinnn 0.1%
|
|
85
|
+
|
|
76
86
|
|
|
77
87
|
## License
|
|
78
88
|
|
package/ReleaseNotes.md
CHANGED
|
@@ -1,5 +1,85 @@
|
|
|
1
1
|
# Release Notes
|
|
2
2
|
|
|
3
|
+
## 1.10.0 / 2014-11-10
|
|
4
|
+
|
|
5
|
+
The following changes are required if you are upgrading from the previous version:
|
|
6
|
+
|
|
7
|
+
- **Users:**
|
|
8
|
+
- No changes required
|
|
9
|
+
- **Plugin Developers:**
|
|
10
|
+
- Review `addChainableNoop` notes below.
|
|
11
|
+
- **Core Contributors:**
|
|
12
|
+
- Refresh `node_modules` folder for updated dependencies.
|
|
13
|
+
|
|
14
|
+
### Noop Function for Terminating Assertion Properties
|
|
15
|
+
|
|
16
|
+
The following assertions can now also be used in the function-call form:
|
|
17
|
+
|
|
18
|
+
* ok
|
|
19
|
+
* true
|
|
20
|
+
* false
|
|
21
|
+
* null
|
|
22
|
+
* undefined
|
|
23
|
+
* exist
|
|
24
|
+
* empty
|
|
25
|
+
* arguments
|
|
26
|
+
* Arguments
|
|
27
|
+
|
|
28
|
+
The above list of assertions are property getters that assert immediately on
|
|
29
|
+
access. Because of that, they were written to be used by terminating the assertion
|
|
30
|
+
chain with a property access.
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
expect(true).to.be.true;
|
|
34
|
+
foo.should.be.ok;
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
This syntax is definitely aesthetically pleasing but, if you are linting your
|
|
38
|
+
test code, your linter will complain with an error something like "Expected an
|
|
39
|
+
assignment or function call and instead saw an expression." Since the linter
|
|
40
|
+
doesn't know about the property getter it assumes this line has no side-effects,
|
|
41
|
+
and throws a warning in case you made a mistake.
|
|
42
|
+
|
|
43
|
+
Squelching these errors is not a good solution as test code is getting to be
|
|
44
|
+
just as important as, if not more than, production code. Catching syntactical
|
|
45
|
+
errors in tests using static analysis is a great tool to help make sure that your
|
|
46
|
+
tests are well-defined and free of typos.
|
|
47
|
+
|
|
48
|
+
A better option was to provide a function-call form for these assertions so that
|
|
49
|
+
the code's intent is more clear and the linters stop complaining about something
|
|
50
|
+
looking off. This form is added in addition to the existing property access form
|
|
51
|
+
and does not impact existing test code.
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
expect(true).to.be.true();
|
|
55
|
+
foo.should.be.ok();
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
These forms can also be mixed in any way, these are all functionally identical:
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
expect(true).to.be.true.and.not.false();
|
|
62
|
+
expect(true).to.be.true().and.not.false;
|
|
63
|
+
expect(true).to.be.true.and.not.false;
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Plugin Authors
|
|
67
|
+
|
|
68
|
+
If you would like to provide this function-call form for your terminating assertion
|
|
69
|
+
properties, there is a new function to register these types of asserts. Instead
|
|
70
|
+
of using `addProperty` to register terminating assertions, simply use `addChainableNoop`
|
|
71
|
+
instead; the arguments to both are identical. The latter will make the assertion
|
|
72
|
+
available in both the attribute and function-call forms and should have no impact
|
|
73
|
+
on existing users of your plugin.
|
|
74
|
+
|
|
75
|
+
### Community Contributions
|
|
76
|
+
|
|
77
|
+
- [#297](https://github.com/chaijs/chai/pull/297) Allow writing lint-friendly tests. [@joshperry](https://github.com/joshperry)
|
|
78
|
+
- [#298](https://github.com/chaijs/chai/pull/298) Add check for logging `-0`. [@dasilvacontin](https://github.com/dasilvacontin)
|
|
79
|
+
- [#300](https://github.com/chaijs/chai/pull/300) Fix #299: the test is defining global variables [@julienw](https://github.com/julienw)
|
|
80
|
+
|
|
81
|
+
Thank you to all who took time to contribute!
|
|
82
|
+
|
|
3
83
|
## 1.9.2 / 2014-09-29
|
|
4
84
|
|
|
5
85
|
The following changes are required if you are upgrading from the previous version:
|