Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the guide to mention the showDiff argument of assert #76

Merged
merged 2 commits into from Mar 1, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion data/guide/plugins/assert.md
Expand Up @@ -32,13 +32,15 @@ the assertion failed and the first error message will be thrown as part of a `ch
Conversely, if the language chain was negated, it will consider `false` a pass and `true` a failure.
The second error message will be included in the thrown error instead.

In all, the `assert` method accepts five arguments:
In all, the `assert` method accepts six arguments:

1. a boolean (result of a truth test)
2. a string error message to be used if the first argument is `false`
3. a string error message to be used if the assertion is negated and the first argument is `true`
4. (optional) the expected value
5. (optional) the actual value, which will default to `_obj`
6. (optional) a boolean which indicates whether to display a diff in addition to the message if the first argument is `false`


### Composing Error Messages

Expand Down
5 changes: 3 additions & 2 deletions out/guide/plugins/index.html
Expand Up @@ -173,13 +173,14 @@ <h3 id="basic-assertion">Basic Assertion</h3>
the assertion failed and the first error message will be thrown as part of a <code>chai.AssertionError</code>.
Conversely, if the language chain was negated, it will consider <code>false</code> a pass and <code>true</code> a failure.
The second error message will be included in the thrown error instead.</p>
<p>In all, the <code>assert</code> method accepts five arguments:</p>
<p>In all, the <code>assert</code> method accepts six arguments:</p>
<ol>
<li>a boolean (result of a truth test)</li>
<li>a string error message to be used if the first argument is <code>false</code></li>
<li>a string error message to be used if the assertion is negated and the first argument is <code>true</code></li>
<li>(optional) the expected value</li>
<li>(optional) the actual value, which will default to <code>_obj</code></li>
<li>(optional) a boolean which indicates whether to display a diff in addition to the message if the first argument is <code>false</code></li>
</ol>
<h3 id="composing-error-messages">Composing Error Messages</h3>
<p>As you can see from the above example, Chai can accept template tags to dynamically compose
Expand Down Expand Up @@ -232,4 +233,4 @@ <h3 class="fancy"><a href="#">Chai Assertion Library</a></h3>
</section>
</footer>
</body>
</html>
</html>