Skip to content

Commit

Permalink
Tests improvements. First version major version!
Browse files Browse the repository at this point in the history
  • Loading branch information
Renie Siqueira committed Aug 29, 2015
1 parent 6c1b0b3 commit d196dff
Show file tree
Hide file tree
Showing 12 changed files with 166 additions and 122 deletions.
10 changes: 8 additions & 2 deletions bin/creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ var Promise = require('promise'),
path = require('path');

function Creator( config ) {
var options = config || {};
if (!config)
throw Error('Missing config param.');

var options = config;

this.paths = {
lib: options.libpath,
Expand Down Expand Up @@ -31,7 +34,10 @@ Creator.prototype = {
me.log('\n\x1b[31mPreparing BBQ.\x1b[0m\n');

me.toCopy.forEach(function(current) {
promises.push(copyFn( path.join(me.paths.lib, current), path.join(me.paths.cli, current) ));
var p1 = path.join(me.paths.lib, current),
p2 = path.join(me.paths.cli, current),
cp = copyFn(p1, p2);
promises.push(cp);
});

Promise.all(promises).then(function() {
Expand Down
2 changes: 1 addition & 1 deletion coverage/coverage.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions coverage/lcov-report/bin/builder.js.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for bin\builder.js</title>
<title>Code coverage report for bin/builder.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
Expand All @@ -13,7 +13,7 @@
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">bin\builder.js</span></h1>
<h1>Code coverage report for <span class="entity">bin/builder.js</span></h1>
<h2>
Statements: <span class="metric">100% <small>(153 / 153)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">96.15% <small>(50 / 52)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Expand Down Expand Up @@ -557,14 +557,14 @@ <h2>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6</span>
<span class="cline-any cline-yes">7</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6</span>
<span class="cline-any cline-yes">7</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6</span>
<span class="cline-any cline-yes">7</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">7</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5</span>
<span class="cline-any cline-yes">1</span>
Expand Down Expand Up @@ -1209,7 +1209,7 @@ <h2>

</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 28 2015 23:39:51 GMT-0300 (Hora oficial do Brasil)</div>
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Aug 29 2015 17:32:03 GMT-0300 (BRT)</div>
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
36 changes: 27 additions & 9 deletions coverage/lcov-report/bin/creator.js.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for bin\creator.js</title>
<title>Code coverage report for bin/creator.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
Expand All @@ -13,12 +13,12 @@
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">bin\creator.js</span></h1>
<h1>Code coverage report for <span class="entity">bin/creator.js</span></h1>
<h2>
Statements: <span class="metric">100% <small>(15 / 15)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">83.33% <small>(5 / 6)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Statements: <span class="metric">100% <small>(18 / 18)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">100% <small>(6 / 6)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(5 / 5)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">100% <small>(15 / 15)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">100% <small>(18 / 18)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">bin/</a> &#187; creator.js</div>
Expand Down Expand Up @@ -68,10 +68,19 @@ <h2>
41
42
43
44</td><td class="line-coverage"><span class="cline-any cline-yes">1</span>
44
45
46
47
48
49
50</td><td class="line-coverage"><span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">5</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4</span>
Expand Down Expand Up @@ -104,6 +113,9 @@ <h2>
<span class="cline-any cline-yes">4</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-yes">1</span>
Expand All @@ -115,7 +127,10 @@ <h2>
path = require('path');
&nbsp;
function Creator( config ) {
var options = config || <span class="branch-1 cbranch-no" title="branch not covered" >{};</span>
if (!config)
throw Error('Missing config param.');
&nbsp;
var options = config;
&nbsp;
this.paths = {
lib: options.libpath,
Expand Down Expand Up @@ -144,7 +159,10 @@ <h2>
me.log('\n\x1b[31mPreparing BBQ.\x1b[0m\n');
&nbsp;
me.toCopy.forEach(function(current) {
promises.push(copyFn( path.join(me.paths.lib, current), path.join(me.paths.cli, current) ));
var p1 = path.join(me.paths.lib, current),
p2 = path.join(me.paths.cli, current),
cp = copyFn(p1, p2);
promises.push(cp);
});

Promise.all(promises).then(function() {
Expand All @@ -159,7 +177,7 @@ <h2>

</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 28 2015 23:39:51 GMT-0300 (Hora oficial do Brasil)</div>
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Aug 29 2015 17:32:03 GMT-0300 (BRT)</div>
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
24 changes: 12 additions & 12 deletions coverage/lcov-report/bin/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for bin\</title>
<title>Code coverage report for bin/</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
Expand All @@ -13,12 +13,12 @@
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">bin\</span></h1>
<h1>Code coverage report for <span class="entity">bin/</span></h1>
<h2>
Statements: <span class="metric">99.11% <small>(222 / 224)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">91.25% <small>(73 / 80)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Statements: <span class="metric">99.12% <small>(225 / 227)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">95% <small>(76 / 80)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(60 / 60)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">99.11% <small>(222 / 224)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">99.12% <small>(225 / 227)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; bin/</div>
Expand Down Expand Up @@ -57,22 +57,22 @@ <h2>
<td class="file high" data-value="creator.js"><a href="creator.js.html">creator.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="15" class="abs high">(15&nbsp;/&nbsp;15)</td>
<td data-value="83.33" class="pct high">83.33%</td>
<td data-value="6" class="abs high">(5&nbsp;/&nbsp;6)</td>
<td data-value="18" class="abs high">(18&nbsp;/&nbsp;18)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">(6&nbsp;/&nbsp;6)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="5" class="abs high">(5&nbsp;/&nbsp;5)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="15" class="abs high">(15&nbsp;/&nbsp;15)</td>
<td data-value="18" class="abs high">(18&nbsp;/&nbsp;18)</td>
</tr>

<tr>
<td class="file high" data-value="utils.js"><a href="utils.js.html">utils.js</a></td>
<td data-value="96.43" class="pic high"><span class="cover-fill" style="width: 96px;"></span><span class="cover-empty" style="width:4px;"></span></td>
<td data-value="96.43" class="pct high">96.43%</td>
<td data-value="56" class="abs high">(54&nbsp;/&nbsp;56)</td>
<td data-value="81.82" class="pct high">81.82%</td>
<td data-value="22" class="abs high">(18&nbsp;/&nbsp;22)</td>
<td data-value="90.91" class="pct high">90.91%</td>
<td data-value="22" class="abs high">(20&nbsp;/&nbsp;22)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="14" class="abs high">(14&nbsp;/&nbsp;14)</td>
<td data-value="96.43" class="pct high">96.43%</td>
Expand All @@ -84,7 +84,7 @@ <h2>
</div>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 28 2015 23:39:51 GMT-0300 (Hora oficial do Brasil)</div>
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Aug 29 2015 17:32:03 GMT-0300 (BRT)</div>
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
34 changes: 17 additions & 17 deletions coverage/lcov-report/bin/utils.js.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for bin\utils.js</title>
<title>Code coverage report for bin/utils.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
Expand All @@ -13,10 +13,10 @@
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">bin\utils.js</span></h1>
<h1>Code coverage report for <span class="entity">bin/utils.js</span></h1>
<h2>
Statements: <span class="metric">96.43% <small>(54 / 56)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">81.82% <small>(18 / 22)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">90.91% <small>(20 / 22)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(14 / 14)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">96.43% <small>(54 / 56)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
Expand Down Expand Up @@ -236,11 +236,11 @@ <h2>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">9</span>
<span class="cline-any cline-yes">9</span>
<span class="cline-any cline-yes">7</span>
<span class="cline-any cline-yes">10</span>
<span class="cline-any cline-yes">10</span>
<span class="cline-any cline-yes">8</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9</span>
<span class="cline-any cline-yes">10</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
Expand Down Expand Up @@ -282,18 +282,18 @@ <h2>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">18</span>
<span class="cline-any cline-yes">20</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18</span>
<span class="cline-any cline-yes">22</span>
<span class="cline-any cline-yes">19</span>
<span class="cline-any cline-yes">24</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">22</span>
<span class="cline-any cline-yes">15</span>
<span class="cline-any cline-yes">24</span>
<span class="cline-any cline-yes">16</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7</span>
<span class="cline-any cline-yes">8</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18</span>
<span class="cline-any cline-yes">19</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand Down Expand Up @@ -373,7 +373,7 @@ <h2>
*/
exports.padNumber = function(num, size) {
var s = String(num);
while (s.length &lt; (size || <span class="branch-1 cbranch-no" title="branch not covered" >2)</span>)
while (s.length &lt; (size || 2))
s = "0" + s;
&nbsp;
return s;
Expand Down Expand Up @@ -418,7 +418,7 @@ <h2>
}
&nbsp;
function deleteFolderRecursive(path) {
<span class="missing-if-branch" title="else path not taken" >E</span>if (fs.existsSync(path)) {
if (fs.existsSync(path)) {

fs.readdirSync(path).forEach(function(file, index) {
var curPath = path + "/" + file;
Expand All @@ -438,7 +438,7 @@ <h2>

</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 28 2015 23:39:51 GMT-0300 (Hora oficial do Brasil)</div>
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Aug 29 2015 17:32:03 GMT-0300 (BRT)</div>
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
22 changes: 11 additions & 11 deletions coverage/lcov-report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<div class="header high">
<h1>Code coverage report for <span class="entity">All files</span></h1>
<h2>
Statements: <span class="metric">99.11% <small>(222 / 224)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">91.25% <small>(73 / 80)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Statements: <span class="metric">99.12% <small>(225 / 227)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">95% <small>(76 / 80)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(60 / 60)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">99.11% <small>(222 / 224)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">99.12% <small>(225 / 227)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"></div>
Expand All @@ -42,23 +42,23 @@ <h2>
</thead>
<tbody><tr>
<td class="file high" data-value="bin/"><a href="bin/index.html">bin/</a></td>
<td data-value="99.11" class="pic high"><span class="cover-fill" style="width: 99px;"></span><span class="cover-empty" style="width:1px;"></span></td>
<td data-value="99.11" class="pct high">99.11%</td>
<td data-value="224" class="abs high">(222&nbsp;/&nbsp;224)</td>
<td data-value="91.25" class="pct high">91.25%</td>
<td data-value="80" class="abs high">(73&nbsp;/&nbsp;80)</td>
<td data-value="99.12" class="pic high"><span class="cover-fill" style="width: 99px;"></span><span class="cover-empty" style="width:1px;"></span></td>
<td data-value="99.12" class="pct high">99.12%</td>
<td data-value="227" class="abs high">(225&nbsp;/&nbsp;227)</td>
<td data-value="95" class="pct high">95%</td>
<td data-value="80" class="abs high">(76&nbsp;/&nbsp;80)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="60" class="abs high">(60&nbsp;/&nbsp;60)</td>
<td data-value="99.11" class="pct high">99.11%</td>
<td data-value="224" class="abs high">(222&nbsp;/&nbsp;224)</td>
<td data-value="99.12" class="pct high">99.12%</td>
<td data-value="227" class="abs high">(225&nbsp;/&nbsp;227)</td>
</tr>

</tbody>
</table>
</div>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 28 2015 23:39:51 GMT-0300 (Hora oficial do Brasil)</div>
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Aug 29 2015 17:32:03 GMT-0300 (BRT)</div>
</div>
<script src="prettify.js"></script>
<script>
Expand Down
Loading

0 comments on commit d196dff

Please sign in to comment.