forked from qunitjs/api.qunitjs.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Partially fix qunitjs#14
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0"?> | ||
<?xml-stylesheet type="text/xsl" href="../entries2html.xsl" ?> | ||
<entry type="method" name="notPropEqual"> | ||
<title>notPropEqual()</title> | ||
<signature> | ||
<argument name="actual" type="Object"> | ||
<desc>Object being tested</desc> | ||
</argument> | ||
<argument name="expected" type="Object"> | ||
<desc>Known comparison value</desc> | ||
</argument> | ||
<argument name="message" type="String"> | ||
<desc>A short description of the assertion</desc> | ||
</argument> | ||
</signature> | ||
<desc> | ||
A strict comparison of an object own properties assertion, checking for inequality. | ||
</desc> | ||
<longdesc> | ||
<p>The <code>notPropEqual</code> assertion uses the strict inverted comparison operator (<code>!==</code>) to compare the actual and expected arguments as Objects regarding only their properties but not their constructors.</p> | ||
<p>When they aren't equal, the assertion passes; otherwise, it fails. When it fails, both actual and expected values are displayed in the test result, in addition to a given message.</p> | ||
<p><a href="/equal"><code>equal()</code></a> can be used to test equality.</p> | ||
<p><a href="/propEqual"><code>propEqual()</code></a> can be used to test strict equality of an Object properties.</p> | ||
</longdesc> | ||
<example> | ||
<desc>Compare the values of two objects properties.</desc> | ||
<code><![CDATA[ | ||
test( "notPropEqual test", function() { | ||
function Foo( x, y, z ) { | ||
this.x = x; | ||
this.y = y; | ||
this.z = z; | ||
} | ||
Foo.prototype.doA = function () {}; | ||
Foo.prototype.doB = function () {}; | ||
Foo.prototype.bar = 'prototype'; | ||
var foo = new Foo( 1, "2", [] ); | ||
var bar = new Foo( "1", 2, {} ); | ||
notPropEqual( foo, bar, "Properties values are strictly compared." ); | ||
}); | ||
]]></code> | ||
</example> | ||
<category slug="assert"/> | ||
</entry> |