Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

diff docs

TJ Holowaychuk8d9879b51632
diff --git a/index.html b/index.html
index 1679a561..62ea94ae 100644
--- a/index.html
+++ b/index.html
@@ -24,6 +24,7 @@
<li>browser support</li>
<li>simple async support</li>
<li>test coverage reporting</li>
+<li>string diff support</li>
<li>proper exit status for CI support etc</li>
<li>auto-detects and disables coloring for non-ttys</li>
<li>maps uncaught exceptions to the correct test case</li>
@@ -157,6 +158,15 @@
<p> <img src="images/reporter-spec-duration.png" alt="test duration" /></p>
+<h2>String diffs</h2>
+
+<p> Mocha supports the <code>err.expected</code>, and <code>err.actual</code> properties
+ when available to present expectations to the developer. Currently
+ Mocha provides string diffs, however in the future object diffs and
+ others may be provided.</p>
+
+<p> <img src="http://f.cl.ly/items/3L0T1A0h2N1J3G021i0F/Screen%20Shot%202012-03-01%20at%202.31.31%20PM.png" alt="string diffs" /></p>
+
<h2>mocha(1)</h2>
<p> Usage: mocha [options] [files]</p>
diff --git a/index.md b/index.md
index be268888..cf5bad96 100644
--- a/index.md
+++ b/index.md
@@ -6,6 +6,7 @@ Mocha is a feature-rich JavaScript test framework running on [node](http://nodej
- browser support
- simple async support
- test coverage reporting
+ - string diff support
- proper exit status for CI support etc
- auto-detects and disables coloring for non-ttys
- maps uncaught exceptions to the correct test case
@@ -128,6 +129,15 @@ Testing asynchronous code with Mocha could not be simpler! Simply invoke the cal
![test duration](images/reporter-spec-duration.png)
+## String diffs
+
+ Mocha supports the `err.expected`, and `err.actual` properties
+ when available to present expectations to the developer. Currently
+ Mocha provides string diffs, however in the future object diffs and
+ others may be provided.
+
+ ![string diffs](http://f.cl.ly/items/3L0T1A0h2N1J3G021i0F/Screen%20Shot%202012-03-01%20at%202.31.31%20PM.png)
+
## mocha(1)
Usage: mocha [options] [files]