oatts-cypress
Version:
An Open API Cypress Test Template Generator
1,625 lines (447 loc) • 23.9 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>compilation - 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>Namespaces</h3><ul><li><a href="compilation.html">compilation</a><ul class='methods'><li data-type='method'><a href="compilation.html#compile">compile</a></li><li data-type='method'><a href="compilation.html#compileOperationLevel">compileOperationLevel</a></li><li data-type='method'><a href="compilation.html#compilePathLevel">compilePathLevel</a></li><li data-type='method'><a href="compilation.html#compileTransactionLevel">compileTransactionLevel</a></li><li data-type='method'><a href="compilation.html#prepareTemplate">prepareTemplate</a></li></ul></li><li><a href="processing.html">processing</a><ul class='methods'><li data-type='method'><a href="processing.html#determineQueryType">determineQueryType</a></li><li data-type='method'><a href="processing.html#isNumberType">isNumberType</a></li><li data-type='method'><a href="processing.html#lookupCustomQueryValue">lookupCustomQueryValue</a></li><li data-type='method'><a href="processing.html#lookupCustomValue">lookupCustomValue</a></li><li data-type='method'><a href="processing.html#pathify">pathify</a></li><li data-type='method'><a href="processing.html#process">process</a></li><li data-type='method'><a href="processing.html#processHeaders">processHeaders</a></li><li data-type='method'><a href="processing.html#processOperations">processOperations</a></li><li data-type='method'><a href="processing.html#processParams">processParams</a></li><li data-type='method'><a href="processing.html#processPaths">processPaths</a></li><li data-type='method'><a href="processing.html#processResponse">processResponse</a></li><li data-type='method'><a href="processing.html#processTransactions">processTransactions</a></li><li data-type='method'><a href="processing.html#replaceNewlines">replaceNewlines</a></li></ul></li><li><a href="templateHelpers.html">templateHelpers</a><ul class='methods'><li data-type='method'><a href="templateHelpers.html#isNotDefaultStatusCode">isNotDefaultStatusCode</a></li><li data-type='method'><a href="templateHelpers.html#json">json</a></li><li data-type='method'><a href="templateHelpers.html#notEmptyObject">notEmptyObject</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html">generate</a></li><li><a href="global.html">merge2</a></li></ul>
</nav>
<div id="main">
<h1 class="page-title">compilation</h1>
<section>
<header>
<h2>
compilation
</h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_compile.js.html">lib/compile.js</a>, <a href="lib_compile.js.html#line28">line 28</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="compile"><span class="type-signature"></span>compile<span class="signature">(processed, options)</span><span class="type-signature"> → {Array.<<a href="compilation.html#.GeneratedTest">compilation.GeneratedTest</a>>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_compile.js.html">lib/compile.js</a>, <a href="lib_compile.js.html#line47">line 47</a>
</li></ul></dd>
</dl>
<div class="description">
Compiles the templated test files with the given processed API spec data
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>processed</code></td>
<td class="type">
<span class="param-type"><a href="processing.html#.ProcessedSpec">processing.ProcessedSpec</a></span>
</td>
<td class="description last">the API spec data processed for test generation</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">for use in compilation of the tests</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.<<a href="compilation.html#.GeneratedTest">compilation.GeneratedTest</a>></span>
</dd>
</dl>
<h4 class="name" id="compileOperationLevel"><span class="type-signature"></span>compileOperationLevel<span class="signature">(processedOp, processedPath, processed, options)</span><span class="type-signature"> → {<a href="compilation.html#.GeneratedOp">compilation.GeneratedOp</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_compile.js.html">lib/compile.js</a>, <a href="lib_compile.js.html#line135">line 135</a>
</li></ul></dd>
</dl>
<div class="description">
Compiles the operation level 'describe' content
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>processedOp</code></td>
<td class="type">
<span class="param-type">processing.ProcessedOp</span>
</td>
<td class="description last">the processed operation object to be compiled</td>
</tr>
<tr>
<td class="name"><code>processedPath</code></td>
<td class="type">
<span class="param-type"><a href="processing.html#.ProcessedPath">processing.ProcessedPath</a></span>
</td>
<td class="description last">the parent processed path object</td>
</tr>
<tr>
<td class="name"><code>processed</code></td>
<td class="type">
<span class="param-type"><a href="processing.html#.ProcessedSpec">processing.ProcessedSpec</a></span>
</td>
<td class="description last">the entire processed API spec</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">for use in test compilation</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="compilation.html#.GeneratedOp">compilation.GeneratedOp</a></span>
</dd>
</dl>
<h4 class="name" id="compilePathLevel"><span class="type-signature"></span>compilePathLevel<span class="signature">(processedPath, processed, options)</span><span class="type-signature"> → {<a href="compilation.html#.GeneratedPath">compilation.GeneratedPath</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_compile.js.html">lib/compile.js</a>, <a href="lib_compile.js.html#line84">line 84</a>
</li></ul></dd>
</dl>
<div class="description">
Compiles the path level 'describe' content
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>processedPath</code></td>
<td class="type">
<span class="param-type"><a href="processing.html#.ProcessedPath">processing.ProcessedPath</a></span>
</td>
<td class="description last">the processed path object to be compiled</td>
</tr>
<tr>
<td class="name"><code>processed</code></td>
<td class="type">
<span class="param-type"><a href="processing.html#.ProcessedSpec">processing.ProcessedSpec</a></span>
</td>
<td class="description last">the entire processed API spec</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">for use in test compilation</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="compilation.html#.GeneratedPath">compilation.GeneratedPath</a></span>
</dd>
</dl>
<h4 class="name" id="compileTransactionLevel"><span class="type-signature"></span>compileTransactionLevel<span class="signature">(transaction, processedOp, processedPath, processed, options)</span><span class="type-signature"> → {<a href="compilation.html#.GeneratedTransaction">compilation.GeneratedTransaction</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_compile.js.html">lib/compile.js</a>, <a href="lib_compile.js.html#line174">line 174</a>
</li></ul></dd>
</dl>
<div class="description">
Compiles the operation level 'describe' content
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>transaction</code></td>
<td class="type">
<span class="param-type"><a href="processing.html#.ProcessedTransaction">processing.ProcessedTransaction</a></span>
</td>
<td class="description last">the processed transaction object to be compiled</td>
</tr>
<tr>
<td class="name"><code>processedOp</code></td>
<td class="type">
<span class="param-type">processing.ProcessedOp</span>
</td>
<td class="description last">the parent processed operation object</td>
</tr>
<tr>
<td class="name"><code>processedPath</code></td>
<td class="type">
<span class="param-type"><a href="processing.html#.ProcessedPath">processing.ProcessedPath</a></span>
</td>
<td class="description last">the parent processed path object</td>
</tr>
<tr>
<td class="name"><code>processed</code></td>
<td class="type">
<span class="param-type"><a href="processing.html#.ProcessedSpec">processing.ProcessedSpec</a></span>
</td>
<td class="description last">the entire processed API spec</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">for use in test compilation</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="compilation.html#.GeneratedTransaction">compilation.GeneratedTransaction</a></span>
</dd>
</dl>
<h4 class="name" id="prepareTemplate"><span class="type-signature"></span>prepareTemplate<span class="signature">(templatePath)</span><span class="type-signature"> → {function}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_compile.js.html">lib/compile.js</a>, <a href="lib_compile.js.html#line198">line 198</a>
</li></ul></dd>
</dl>
<div class="description">
prepares a handlebars template for the template given by the path
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>templatePath</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">path to the template to load</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">function</span>
</dd>
</dl>
<h3 class="subsection-title">Type Definitions</h3>
<h4 class="name" id=".GeneratedOp">GeneratedOp</h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_compile.js.html">lib/compile.js</a>, <a href="lib_compile.js.html#line127">line 127</a>
</li></ul></dd>
</dl>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>operationLevelDescription</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the operation level description to use incompilation</td>
</tr>
<tr>
<td class="name"><code>operationLevelTests</code></td>
<td class="type">
<span class="param-type">Array.<<a href="compilation.html#.GeneratedTransaction">compilation.GeneratedTransaction</a>></span>
</td>
<td class="description last">Generated test file contents</td>
</tr>
</tbody>
</table>
<div class="description">
GeneratedOp is the result of procressing an operation & compiling the operation-level test code
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h4 class="name" id=".GeneratedPath">GeneratedPath</h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_compile.js.html">lib/compile.js</a>, <a href="lib_compile.js.html#line77">line 77</a>
</li></ul></dd>
</dl>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>test</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the generated test code portion</td>
</tr>
</tbody>
</table>
<div class="description">
GeneratedPath is the result of procressing a path & compiling the path-level test code
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h4 class="name" id=".GeneratedTest">GeneratedTest</h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_compile.js.html">lib/compile.js</a>, <a href="lib_compile.js.html#line39">line 39</a>
</li></ul></dd>
</dl>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>filename</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">A file name based off of the path being tested</td>
</tr>
<tr>
<td class="name"><code>contents</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Generated test file contents</td>
</tr>
</tbody>
</table>
<div class="description">
GeneratedTest is the set of results from procressing a spec & compiling the test code
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h4 class="name" id=".GeneratedTransaction">GeneratedTransaction</h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_compile.js.html">lib/compile.js</a>, <a href="lib_compile.js.html#line168">line 168</a>
</li></ul></dd>
</dl>
<div class="description">
GeneratedTransaction is the compiled unit test code for a specific transaction
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
</article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sat Aug 24 2019 12:31:35 GMT+0100 (Western European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>