Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Entries: Add notOk() entry
Closes gh-99
  • Loading branch information
piranna authored and arthurvr committed Apr 6, 2015
1 parent c7fa09e commit eee5583
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions entries/notOk.xml
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../entries2html.xsl" ?>
<entry type="method" name="notOk">
<title>notOk()</title>
<signature>
<argument name="state" type="Expression">
<desc>Expression being tested</desc>
</argument>
<argument name="message" type="String" optional="true">
<desc>A short description of the assertion</desc>
</argument>
</signature>
<desc>
A boolean check, inverse of ok() and CommonJS's assert.ok(), and equivalent to JUnit's assertFalse(). Passes if the first argument is falsy.
</desc>
<longdesc>
<p><code>notOk()</code> requires just one argument. If the argument evaluates to false, the assertion passes; otherwise, it fails. If a second message argument is provided, it will be displayed in place of the result.</p>
</longdesc>
<example height="250">

<code><![CDATA[
QUnit.test( "notOk test", function( assert ) {
assert.notOk( false, "false succeeds" );
assert.notOk( "", "empty string succeeds" );
assert.notOk( NaN, "NaN succeeds" );
assert.notOk( null, "null succeeds" );
assert.notOk( undefined, "undefined succeeds" );
assert.notOk( true, "true fails" );
assert.notOk( 1, "1 fails" );
assert.notOk( "not-empty", "not-empty string fails" );
});
]]></code>
</example>

<category slug="assert"/>
</entry>

0 comments on commit eee5583

Please sign in to comment.