Skip to content

Commit

Permalink
0.1.0
Browse files Browse the repository at this point in the history
- removes the versioning from the api endpoints
- abstracts fileView from coverageFile view
- cleans the input lcov before trying to parse it
- actually tests cli code with a pipe from tap
  • Loading branch information
gabrielcsapo committed Sep 17, 2017
1 parent ed7cea8 commit 8a3043e
Show file tree
Hide file tree
Showing 56 changed files with 1,614 additions and 814 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015", "react"]
}
3 changes: 3 additions & 0 deletions .storybook/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015", "react"]
}
15 changes: 3 additions & 12 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
module.exports = {
module: {
rules: [{
test: /\.css$/,
loaders: ['style-loader', 'css-loader']
},
{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015', 'react']
}
}
]
test: /\.css$/,
use: ['style-loader', 'css-loader'],
}]
}
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 0.1.0 (09/17/2017)

- removes the versioning from the api endpoints
- abstracts fileView from coverageFile view
- cleans the input lcov before trying to parse it
- actually tests cli code with a pipe from tap

# 0.0.3

- fixes tooltip displaying the correct value for coverage
Expand Down
2 changes: 1 addition & 1 deletion bin/lcov-server-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ process.stdin.on('end', () => {
const options = {
hostname: parsedUrl.hostname,
port: parsedUrl.port || 80,
path: '/api/v1/upload',
path: '/api/upload',
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion dist/build.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/code/Coverage.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<label for="nav-trigger" class="overlay"></label>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Coverage.html">Coverage</a><ul class='methods'><li data-type='method'><a href="Coverage.html#.get">get</a></li><li data-type='method'><a href="Coverage.html#.save">save</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-util_git.html">util/git</a><ul class='methods'><li data-type='method'><a href="module-util_git.html#~parse">parse</a></li></ul></li><li><a href="module-util_lcov.html">util/lcov</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Coverage.html">Coverage</a><ul class='methods'><li data-type='method'><a href="Coverage.html#.get">get</a></li><li data-type='method'><a href="Coverage.html#.save">save</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-lib_git.html">lib/git</a><ul class='methods'><li data-type='method'><a href="module-lib_git.html#~parse">parse</a></li></ul></li><li><a href="module-lib_lcov.html">lib/lcov</a><ul class='methods'><li data-type='method'><a href="module-lib_lcov.html#~clean">clean</a></li></ul></li></ul>
</nav>

<div id="main">
Expand Down Expand Up @@ -1255,7 +1255,7 @@ <h4 class="name" id=".get"><span class="type-signature">(static) </span>get<span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="coverage.js.html">coverage.js</a>, <a href="coverage.js.html#line123">line 123</a>
<a href="coverage.js.html">coverage.js</a>, <a href="coverage.js.html#line124">line 124</a>
</li></ul></dd>


Expand Down Expand Up @@ -1582,7 +1582,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Wed Sep 13 2017 18:27:42 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Sep 17 2017 16:54:02 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
91 changes: 46 additions & 45 deletions docs/code/coverage.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<label for="nav-trigger" class="overlay"></label>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Coverage.html">Coverage</a><ul class='methods'><li data-type='method'><a href="Coverage.html#.get">get</a></li><li data-type='method'><a href="Coverage.html#.save">save</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-util_git.html">util/git</a><ul class='methods'><li data-type='method'><a href="module-util_git.html#~parse">parse</a></li></ul></li><li><a href="module-util_lcov.html">util/lcov</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Coverage.html">Coverage</a><ul class='methods'><li data-type='method'><a href="Coverage.html#.get">get</a></li><li data-type='method'><a href="Coverage.html#.save">save</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-lib_git.html">lib/git</a><ul class='methods'><li data-type='method'><a href="module-lib_git.html#~parse">parse</a></li></ul></li><li><a href="module-lib_lcov.html">lib/lcov</a><ul class='methods'><li data-type='method'><a href="module-lib_lcov.html#~clean">clean</a></li></ul></li></ul>
</nav>

<div id="main">
Expand Down Expand Up @@ -137,55 +137,56 @@ <h1 class="page-title">coverage.js</h1>
const CoverageModel = new mongoose.Schema({}, { _id: false, strict: false });
const Coverage = mongoose.model('coverages', CoverageModel);

module.exports = {
/**
* saves a coverage model the collection
* @function save
* @memberof Coverage
* @param {Coverage} model - the coverage model
* @return {Promise} - a promise that resolves with the model after it was inserted
*/
save: (model) => {
return new Promise((resolve, reject) => {
const { git } = model;
const _id = `${git.commit}#${git.branch}`;

model['_id'] = _id;
Coverage.findOneAndUpdate({
_id
}, model, { upsert: true }, (err, result) => {
if(err) { return reject(err); }
return resolve(result);
});
/**
* saves a coverage model the collection
* @function save
* @memberof Coverage
* @param {Coverage} model - the coverage model
* @return {Promise} - a promise that resolves with the model after it was inserted
*/
module.exports.save = function save(model) {
return new Promise((resolve, reject) => {
const { git } = model;
const _id = `${git.commit}#${git.branch}`;

model['_id'] = _id;
Coverage.findOneAndUpdate({
_id
}, model, { upsert: true }, (err, result) => {
if(err) { return reject(err); }
return resolve(result);
});
},
/**
* gets a repos coverage model or all coverage models
* @function get
* @memberof Coverage
* @param {string=} repo - the url of the repo
* @return {Coverage[]} - a promise that resolves with the model after it was inserted
*/
get: (repo) => {
return new Promise((resolve, reject) => {
const options = [{
$group: {
_id: "$git.remotes.url",
history: {
$push: "$$ROOT"
}
});
};

/**
* gets a repos coverage model or all coverage models
* @function get
* @memberof Coverage
* @param {string=} repo - the url of the repo
* @return {Coverage[]} - a promise that resolves with the model after it was inserted
*/
module.exports.get = function get(repo) {
return new Promise((resolve, reject) => {
const options = [{
$group: {
_id: "$git.remotes.url",
history: {
$push: "$$ROOT"
}
}];
}
}];

if(repo)
options.unshift({ $match: { "git.remotes.url": repo} });
if(repo) {
options.unshift({ $match: { "git.remotes.url": repo} });
}

Coverage.aggregate(options, (err, docs) => {
if(err) { return reject(err); }
return resolve(docs);
});
Coverage.aggregate(options, (err, docs) => {
if(err) { return reject(err); }
return resolve(docs);
});
}
});
};
</code></pre>
</article>
Expand All @@ -199,7 +200,7 @@ <h1 class="page-title">coverage.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Wed Sep 13 2017 18:27:42 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Sep 17 2017 16:54:02 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
6 changes: 3 additions & 3 deletions docs/code/git.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<label for="nav-trigger" class="overlay"></label>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Coverage.html">Coverage</a><ul class='methods'><li data-type='method'><a href="Coverage.html#.get">get</a></li><li data-type='method'><a href="Coverage.html#.save">save</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-util_git.html">util/git</a><ul class='methods'><li data-type='method'><a href="module-util_git.html#~parse">parse</a></li></ul></li><li><a href="module-util_lcov.html">util/lcov</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Coverage.html">Coverage</a><ul class='methods'><li data-type='method'><a href="Coverage.html#.get">get</a></li><li data-type='method'><a href="Coverage.html#.save">save</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-lib_git.html">lib/git</a><ul class='methods'><li data-type='method'><a href="module-lib_git.html#~parse">parse</a></li></ul></li><li><a href="module-lib_lcov.html">lib/lcov</a><ul class='methods'><li data-type='method'><a href="module-lib_lcov.html#~clean">clean</a></li></ul></li></ul>
</nav>

<div id="main">
Expand All @@ -40,7 +40,7 @@ <h1 class="page-title">git.js</h1>
<pre class="prettyprint source linenums"><code>'use strict';

/**
* @module util/git
* @module lib/git
*/

const exec = require('child_process').exec;
Expand Down Expand Up @@ -139,7 +139,7 @@ <h1 class="page-title">git.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Wed Sep 13 2017 18:27:42 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Sep 17 2017 16:54:02 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
26 changes: 14 additions & 12 deletions docs/code/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<label for="nav-trigger" class="overlay"></label>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Coverage.html">Coverage</a><ul class='methods'><li data-type='method'><a href="Coverage.html#.get">get</a></li><li data-type='method'><a href="Coverage.html#.save">save</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-util_git.html">util/git</a><ul class='methods'><li data-type='method'><a href="module-util_git.html#~parse">parse</a></li></ul></li><li><a href="module-util_lcov.html">util/lcov</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Coverage.html">Coverage</a><ul class='methods'><li data-type='method'><a href="Coverage.html#.get">get</a></li><li data-type='method'><a href="Coverage.html#.save">save</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-lib_git.html">lib/git</a><ul class='methods'><li data-type='method'><a href="module-lib_git.html#~parse">parse</a></li></ul></li><li><a href="module-lib_lcov.html">lib/lcov</a><ul class='methods'><li data-type='method'><a href="module-lib_lcov.html#~clean">clean</a></li></ul></li></ul>
</nav>

<div id="main">
Expand Down Expand Up @@ -67,25 +67,27 @@ <h1>Install</h1><pre class="prettyprint source"><code>npm install lcov-server -g
<pre class="prettyprint source"><code>tap test --coverage-report=text-lcov | lcov-server-cli</code></pre><blockquote>
<p>cli:help</p>
</blockquote>
<pre class="prettyprint source"><code>Usage: lcov-server-cli [options]
<pre class="prettyprint source"><code> Usage: lcov-server-cli [options]

Options:

-h, --help output usage information
-V, --version output the version number
-u, --url [db] Set the url to upload lcov data too</code></pre><blockquote>
Options:

-V, --version output the version number
-u, --url [server] Set the url to upload lcov data too
-h, --help output usage information</code></pre><blockquote>
<p>server</p>
</blockquote>
<pre class="prettyprint source"><code>lcov-server</code></pre><blockquote>
<p>server:help</p>
</blockquote>
<pre class="prettyprint source"><code>Usage: lcov-server [options]
<pre class="prettyprint source"><code> Usage: lcov-server [options]


Options:
Options:

-h, --help output usage information
-V, --version output the version number
-d, --db Set the db connection</code></pre></article>
-V, --version output the version number
-d, --db [db] Set the db connection
-h, --help output usage information</code></pre></article>
</section>


Expand All @@ -98,7 +100,7 @@ <h1>Install</h1><pre class="prettyprint source"><code>npm install lcov-server -g
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Wed Sep 13 2017 18:27:42 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Sep 17 2017 16:54:02 GMT-0700 (PDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
Loading

0 comments on commit 8a3043e

Please sign in to comment.