Skip to content

Commit 813f550

Browse files
committed
1.2.5
- updates dependencies - fixes db having a default address
1 parent 043a6c0 commit 813f550

10 files changed

+2330
-41
lines changed

tryitout.js .tryitout

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ module.exports = {
1111
Docs: './code/index.html',
1212
Storybook: './storybook/index.html',
1313
Example: 'http://lcov-server.gabrielcsapo.com'
14-
}
14+
},
15+
output: './docs',
16+
template: 'product'
1517
};

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 1.2.5 (01/12/2018)
2+
3+
- updates dependencies
4+
- fixes db having a default address
5+
16
# 1.2.4 (12/07/2017)
27

38
- fixes prepublish step

bin/lcov-server.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ args.forEach((a, i) => {
2929
Usage: lcov-server [options]
3030
3131
Commands:
32-
32+
3333
upload, --upload, -u [server ] Set the url to upload lcov data too (default: http://localhost:8080)
3434
serve, -s, --serve Pass this option to startup a lcov-server instance
3535
version, -v, --version output the version number
@@ -77,9 +77,8 @@ args.forEach((a, i) => {
7777

7878
const { parser, upload, serve, db, basePath } = program;
7979

80-
8180
if(serve) {
82-
process.env.MONGO_URL = process.env.MONGO_URL || db;
81+
process.env.MONGO_URL = process.env.MONGO_URL || db || 'mongodb://localhost:32768/lcov-server';
8382

8483
require('../index');
8584
} else {

dist/bundle.js

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/code/ci.js.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ <h1 class="page-title">ci.js</h1>
6767
options.service_name = 'travis-ci';
6868
options.service_job_id = process.env.TRAVIS_JOB_ID;
6969
options.service_pull_request = process.env.TRAVIS_PULL_REQUEST;
70-
options.commit = 'HEAD';
7170
options.message = process.env.TRAVIS_COMMIT_MESSAGE;
72-
options.branch = process.env.TRAVIS_BRANCH || process.env.TRAVIS_PULL_REQUEST_BRANCH;
71+
options.branch = process.env.TRAVIS_BRANCH || process.env.TRAVIS_PULL_REQUEST_BRANCH || process.env.TRAVIS_TAG;
7372
}
7473

7574
if (process.env.DRONE){

docs/code/coverage.js.html

+22-5
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,12 @@ <h1 class="page-title">coverage.js</h1>
219219
Coverage.aggregate(options, (err, docs) => {
220220
if(err) { return reject(err); }
221221
// this might happen if the data is malformed
222-
if(docs.length > 1) {
222+
if(docs.length == 1) {
223+
docs[0].history = docs[0].history.sort((a, b) => {
224+
return moment(a['run_at']) - moment(b['run_at']) > 0 ? -1 : 1;
225+
});
226+
return resolve(docs);
227+
} else if(docs.length > 1){
223228
var condensed = docs[0];
224229
for(var i = 1; i &lt; docs.length; i++) {
225230
condensed.history = condensed.history.concat(docs[i].history);
@@ -228,14 +233,26 @@ <h1 class="page-title">coverage.js</h1>
228233
return moment(a['run_at']) - moment(b['run_at']) > 0 ? -1 : 1;
229234
});
230235
return resolve([condensed]);
236+
} else {
237+
return reject('no coverage was found');
231238
}
232-
docs[0].history = docs[0].history.sort((a, b) => {
233-
return moment(a['run_at']) - moment(b['run_at']) > 0 ? -1 : 1;
234-
});
235-
return resolve(docs);
236239
});
237240
});
238241
};
242+
243+
module.exports.feed = function feed(limit=10) {
244+
return new Promise((resolve, reject) => {
245+
let options = [
246+
{ $sort: { "run_at": -1 } },
247+
{ $limit: parseInt(limit) }
248+
];
249+
250+
Coverage.aggregate(options, (err, docs) => {
251+
if(err) { return reject(err); }
252+
return resolve(docs);
253+
});
254+
});
255+
};
239256
</code></pre>
240257
</article>
241258
</section>

docs/code/index.html

+9-7
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,18 @@ <h1>Prerequisites</h1><ul>
7676
</ul>
7777
<h1>Install</h1><pre class="prettyprint source"><code>npm install lcov-server -g</code></pre><h1>Usage</h1><pre class="prettyprint source"><code>Usage: lcov-server [options]
7878

79+
Commands:
80+
81+
upload, --upload, -u [server ] Set the url to upload lcov data too (default: http://localhost:8080)
82+
serve, -s, --serve Pass this option to startup a lcov-server instance
83+
version, -v, --version output the version number
84+
help, -h, --help output usage information
7985

8086
Options:
8187

82-
-V, --version output the version number
83-
-u, --upload [server] Set the url to upload lcov data too
84-
-s, --serve Pass this option to startup a lcov-server instance
85-
-d, --db [db] Set the db connection
86-
-p, --parser &lt;parser> Set the parser value [lcov, cobertura, golang, jacoco], defaults to lcov
87-
-bp, --basePath &lt;path> The path that defines the base directory where the files that were covered will be located
88-
-h, --help output usage information</code></pre><h2>Upload</h2><pre class="prettyprint source"><code>tap test --coverage-report=text-lcov | lcov-server --upload http://...</code></pre><h2>Server</h2><pre class="prettyprint source"><code>lcov-server --serve --db mongodb://localhost:32768/lcov-server</code></pre></article>
88+
db, -d, --db [db] Set the db connection (default: mongodb://localhost:32768/lcov-server)
89+
parser, -p, --parser &lt;parser> Set the parser value [lcov, cobertura, golang, jacoco], defaults to lcov (default: lcov)
90+
basePath, -bp, --basePath &lt;path> The path that defines the base directory where the files that were covered will be located</code></pre><h2>Upload</h2><pre class="prettyprint source"><code>tap test --coverage-report=text-lcov | lcov-server --upload http://...</code></pre><h2>Server</h2><pre class="prettyprint source"><code>lcov-server --serve --db mongodb://localhost:32768/lcov-server</code></pre></article>
8991
</section>
9092

9193

0 commit comments

Comments
 (0)