UNPKG

nisemono

Version:

Pretty simple test double library

578 lines (154 loc) 8.37 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Global - Documentation</title> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc.css"> </head> <body> <input type="checkbox" id="nav-trigger" class="nav-trigger" /> <label for="nav-trigger" class="navicon-button x"> <div class="navicon"></div> </label> <label for="nav-trigger" class="overlay"></label> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Call.html">Call</a></li><li><a href="Expectation.html">Expectation</a><ul class='methods'><li data-type='method'><a href="Expectation.html#withArgs">withArgs</a></li><li data-type='method'><a href="Expectation.html#returns">returns</a></li><li data-type='method'><a href="Expectation.html#throws">throws</a></li><li data-type='method'><a href="Expectation.html#resolves">resolves</a></li><li data-type='method'><a href="Expectation.html#rejects">rejects</a></li><li data-type='method'><a href="Expectation.html#calls">calls</a></li></ul></li><li><a href="FakeFunction.html">FakeFunction</a><ul class='methods'><li data-type='method'><a href="FakeFunction.html#callArgFuncAt">callArgFuncAt</a></li></ul></li></ul><h3>Namespaces</h3><ul><li><a href="promise.html">promise</a><ul class='methods'><li data-type='method'><a href="promise.html#.constructor">constructor</a></li><li data-type='method'><a href="promise.html#.use">use</a></li><li data-type='method'><a href="promise.html#.restoreDefault">restoreDefault</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#expects">expects</a></li><li><a href="global.html#func">func</a></li><li><a href="global.html#obj">obj</a></li></ul> </nav> <div id="main"> <h1 class="page-title">Global</h1> <section> <header> <h2> </h2> </header> <article> <div class="container-overview"> <dl class="details"> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="expects"><span class="type-signature"></span>expects<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Expectation.html">Expectation</a>}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="expects.js.html">expects.js</a>, <a href="expects.js.html#line3">line 3</a> </li></ul></dd> </dl> <div class="description"> <p>Create a new expectation of the function or method</p> </div> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="Expectation.html">Expectation</a></span> </dd> </dl> <h4 class="name" id="func"><span class="type-signature"></span>func<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="FakeFunction.html">FakeFunction</a>}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="func.js.html">func.js</a>, <a href="func.js.html#line6">line 6</a> </li></ul></dd> </dl> <div class="description"> <p>Create a fake function</p> </div> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="FakeFunction.html">FakeFunction</a></span> </dd> </dl> <h4 class="name" id="obj"><span class="type-signature"></span>obj<span class="signature">(object)</span><span class="type-signature"> &rarr; {Object}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="obj.js.html">obj.js</a>, <a href="obj.js.html#line18">line 18</a> </li></ul></dd> </dl> <div class="description"> <p>Create a fake object. The fake object has cloned properties and cloned methods or fake methods:</p> <ul> <li>The methods in <code>except</code> options are copied to the fake object from original object.</li> <li>The methods in <code>only</code> options are fake functions.</li> <li>As default, All methods are fake functions.</li> </ul> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>object</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="attributes"> </td> <td class="description last"><p>a fake object</p></td> </tr> <tr> <td class="name"><code>opts.except</code></td> <td class="type"> <span class="param-type">Array.&lt;string></span> </td> <td class="attributes"> &lt;nullable><br> </td> <td class="description last"><p>method name list. the methods of a object are not fake function, use original method.</p></td> </tr> <tr> <td class="name"><code>opts.only</code></td> <td class="type"> <span class="param-type">Array.&lt;string></span> </td> <td class="attributes"> &lt;nullable><br> </td> <td class="description last"><p>method name list. The methods of a object are fake function instead of original method.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>a fake object</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Object</span> </dd> </dl> </article> </section> </div> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun Jan 29 2017 08:56:25 GMT+0900 (JST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. </footer> <script>prettyPrint();</script> <script src="scripts/linenumber.js"></script> </body> </html>