UNPKG

nisemono

Version:

Pretty simple test double library

862 lines (183 loc) 10.4 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Expectation - 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">Expectation</h1> <section> <header> <h2> Expectation </h2> </header> <article> <div class="container-overview"> <h4 class="name" id="Expectation"><span class="type-signature"></span>new Expectation<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="expectation.js.html">expectation.js</a>, <a href="expectation.js.html#line12">line 12</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Members</h3> <h4 class="name" id="isFulfilled"><span class="type-signature"></span>isFulfilled<span class="type-signature"> :bool</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="expectation.js.html">expectation.js</a>, <a href="expectation.js.html#line26">line 26</a> </li></ul></dd> </dl> <div class="description"> <p>bool value if the expectation is fulfilled or not</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">bool</span> </li> </ul> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="withArgs"><span class="type-signature"></span>withArgs<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="expectation.js.html">expectation.js</a>, <a href="expectation.js.html#line33">line 33</a> </li></ul></dd> </dl> <div class="description"> <p>Add condition about arguments</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="returns"><span class="type-signature"></span>returns<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="expectation.js.html">expectation.js</a>, <a href="expectation.js.html#line43">line 43</a> </li></ul></dd> </dl> <div class="description"> <p>Expects the function returns specified value</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="throws"><span class="type-signature"></span>throws<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="expectation.js.html">expectation.js</a>, <a href="expectation.js.html#line53">line 53</a> </li></ul></dd> </dl> <div class="description"> <p>Expects the function throws specified error</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="resolves"><span class="type-signature"></span>resolves<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="expectation.js.html">expectation.js</a>, <a href="expectation.js.html#line63">line 63</a> </li></ul></dd> </dl> <div class="description"> <p>Expects the function returns a promise object that resolves specified value</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="rejects"><span class="type-signature"></span>rejects<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="expectation.js.html">expectation.js</a>, <a href="expectation.js.html#line73">line 73</a> </li></ul></dd> </dl> <div class="description"> <p>Expects the function returns a promise object that rejects specified value</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="calls"><span class="type-signature"></span>calls<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="expectation.js.html">expectation.js</a>, <a href="expectation.js.html#line83">line 83</a> </li></ul></dd> </dl> <div class="description"> <p>Expects the function calls specified function</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> </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>