Add istanbul and generate ininital coverage report

This commit is contained in:
terakilobyte
2015-06-11 21:21:02 -04:00
parent a5092d379d
commit f0604ec9c7
45 changed files with 17156 additions and 36 deletions

View File

@@ -0,0 +1,165 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for server/boot/a-extendUser.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../prettify.css">
<link rel="stylesheet" href="../../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header low">
<h1>Code coverage report for <span class="entity">server/boot/a-extendUser.js</span></h1>
<h2>
Statements: <span class="metric">34.78% <small>(8 / 23)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">0% <small>(0 / 8)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">14.29% <small>(1 / 7)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">36.36% <small>(8 / 22)</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">server/boot/</a> &#187; a-extendUser.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41</td><td class="line-coverage"><span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<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-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var Rx = require('rx');
var debug = require('debug')('freecc:user:remote');
&nbsp;
<span class="fstat-no" title="function not covered" >function destroyById(id, Model) {</span>
<span class="cstat-no" title="statement not covered" > return Rx.Observable.create(<span class="fstat-no" title="function not covered" >function(observer) {</span></span>
<span class="cstat-no" title="statement not covered" > Model.destroyById(id, <span class="fstat-no" title="function not covered" >function(err) {</span></span>
<span class="cstat-no" title="statement not covered" > if (err) { <span class="cstat-no" title="statement not covered" >return observer.onError(err); </span>}</span>
<span class="cstat-no" title="statement not covered" > observer.onCompleted();</span>
});
<span class="cstat-no" title="statement not covered" > return Rx.Disposable(Rx.helpers.noop);</span>
});
}
&nbsp;
module.exports = function(app) {
var User = app.models.User;
var UserIdentity = app.models.UserIdentity;
var UserCredential = app.models.UserCredential;
User.observe('after delete', <span class="fstat-no" title="function not covered" >function(ctx, next) {</span>
<span class="cstat-no" title="statement not covered" > debug('removing user', ctx.where);</span>
<span class="cstat-no" title="statement not covered" > var id = ctx.where &amp;&amp; ctx.where.id ? ctx.where.id : null;</span>
<span class="cstat-no" title="statement not covered" > if (!id) {</span>
<span class="cstat-no" title="statement not covered" > return next();</span>
}
<span class="cstat-no" title="statement not covered" > Rx.Observable.combineLatest(</span>
destroyById(id, UserIdentity),
destroyById(id, UserCredential),
Rx.helpers.noop
).subscribe(
Rx.helpers.noop,
<span class="fstat-no" title="function not covered" > function(err) {</span>
<span class="cstat-no" title="statement not covered" > debug('error deleting user %s stuff', id, err);</span>
<span class="cstat-no" title="statement not covered" > next(err);</span>
},
<span class="fstat-no" title="function not covered" > function() {</span>
<span class="cstat-no" title="statement not covered" > debug('user stuff deleted for user %s', id);</span>
<span class="cstat-no" title="statement not covered" > next();</span>
}
);
});
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jun 11 2015 21:16:17 GMT-0400 (EDT)</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

View File

@@ -0,0 +1,57 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for server/boot/authentication.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../prettify.css">
<link rel="stylesheet" href="../../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">server/boot/authentication.js</span></h1>
<h2>
Statements: <span class="metric">100% <small>(2 / 2)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">100% <small>(0 / 0)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(1 / 1)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">100% <small>(2 / 2)</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">server/boot/</a> &#187; authentication.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5</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-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function enableAuthentication(app) {
// enable authentication
app.enableAuth();
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jun 11 2015 21:16:17 GMT-0400 (EDT)</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,240 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for server/boot/challengeMap.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../prettify.css">
<link rel="stylesheet" href="../../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header low">
<h1>Code coverage report for <span class="entity">server/boot/challengeMap.js</span></h1>
<h2>
Statements: <span class="metric">32.26% <small>(10 / 31)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">0% <small>(0 / 4)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">11.11% <small>(1 / 9)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">33.33% <small>(10 / 30)</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">server/boot/</a> &#187; challengeMap.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66</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-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">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</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-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<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-neutral">&nbsp;</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></td><td class="text"><pre class="prettyprint lang-js">var R = require('ramda'),
// debug = require('debug')('freecc:cntr:challengeMap'),
utils = require('./../utils'),
middleware = require('../utils/middleware');
&nbsp;
&nbsp;
module.exports = function(app) {
var User = app.models.User;
var router = app.loopback.Router();
&nbsp;
router.get('/map', middleware.userMigration, challengeMap);
router.get('/learn-to-code', <span class="fstat-no" title="function not covered" >function(req, res) {</span>
<span class="cstat-no" title="statement not covered" > res.redirect(301, '/map');</span>
});
router.get('/about', <span class="fstat-no" title="function not covered" >function(req, res) {</span>
<span class="cstat-no" title="statement not covered" > res.redirect(301, '/map');</span>
});
&nbsp;
app.use(router);
&nbsp;
<span class="fstat-no" title="function not covered" > function challengeMap(req, res, next) {</span>
<span class="cstat-no" title="statement not covered" > var completedList = [];</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > if (req.user) {</span>
<span class="cstat-no" title="statement not covered" > completedList = req.user.completedChallenges;</span>
}
&nbsp;
<span class="cstat-no" title="statement not covered" > var noDuplicatedChallenges = R.uniq(completedList);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > var completedChallengeList = noDuplicatedChallenges</span>
.map(<span class="fstat-no" title="function not covered" >function(challenge) {</span>
<span class="cstat-no" title="statement not covered" > return challenge.id;</span>
});
<span class="cstat-no" title="statement not covered" > var challengeList = utils.</span>
getChallengeMapForDisplay(completedChallengeList);
&nbsp;
<span class="cstat-no" title="statement not covered" > Object.keys(challengeList).forEach(<span class="fstat-no" title="function not covered" >function(key) {</span></span>
<span class="cstat-no" title="statement not covered" > challengeList[key].completed = challengeList[key]</span>
.challenges.filter(<span class="fstat-no" title="function not covered" >function(elem) {</span>
<span class="cstat-no" title="statement not covered" > return completedChallengeList.indexOf(elem.id) &gt; -1;</span>
});
});
&nbsp;
<span class="fstat-no" title="function not covered" > function numberWithCommas(x) {</span>
<span class="cstat-no" title="statement not covered" > return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');</span>
}
&nbsp;
<span class="cstat-no" title="statement not covered" > var date1 = new Date('10/15/2014');</span>
<span class="cstat-no" title="statement not covered" > var date2 = new Date();</span>
<span class="cstat-no" title="statement not covered" > var timeDiff = Math.abs(date2.getTime() - date1.getTime());</span>
<span class="cstat-no" title="statement not covered" > var daysRunning = Math.ceil(timeDiff / (1000 * 3600 * 24));</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > User.count(<span class="fstat-no" title="function not covered" >function(err, camperCount) {</span></span>
<span class="cstat-no" title="statement not covered" > if (err) { <span class="cstat-no" title="statement not covered" >return next(err); </span>}</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > res.render('challengeMap/show', {</span>
daysRunning: daysRunning,
camperCount: numberWithCommas(camperCount),
title: "A map of all Free Code Camp's Challenges",
challengeList: challengeList,
completedChallengeList: completedChallengeList
});
});
}
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jun 11 2015 21:16:17 GMT-0400 (EDT)</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

View File

@@ -0,0 +1,135 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for server/boot/explorer.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../prettify.css">
<link rel="stylesheet" href="../../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header medium">
<h1>Code coverage report for <span class="entity">server/boot/explorer.js</span></h1>
<h2>
Statements: <span class="metric">56.25% <small>(9 / 16)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">25% <small>(1 / 4)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">33.33% <small>(1 / 3)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">56.25% <small>(9 / 16)</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">server/boot/</a> &#187; explorer.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31</td><td class="line-coverage"><span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<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-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<span class="cline-any cline-no">&nbsp;</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-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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></td><td class="text"><pre class="prettyprint lang-js">module.exports = function mountLoopBackExplorer(app) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (process.env.NODE_ENV === 'production') {
<span class="cstat-no" title="statement not covered" > return;</span>
}
var explorer;
try {
explorer = require('loopback-explorer');
} catch(err) {
// Print the message only when the app was started via `app.listen()`.
// Do not print any message when the project is used as a component.
<span class="cstat-no" title="statement not covered" > app.once('started', <span class="fstat-no" title="function not covered" >function() {</span></span>
<span class="cstat-no" title="statement not covered" > console.log(</span>
'Run `npm install loopback-explorer` to enable the LoopBack explorer'
);
});
<span class="cstat-no" title="statement not covered" > return;</span>
}
&nbsp;
var restApiRoot = app.get('restApiRoot');
&nbsp;
var explorerApp = explorer(app, { basePath: restApiRoot });
app.use('/explorer', explorerApp);
app.once('started', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" > var baseUrl = app.get('url').replace(/\/$/, '');</span>
// express 4.x (loopback 2.x) uses `mountpath`
// express 3.x (loopback 1.x) uses `route`
<span class="cstat-no" title="statement not covered" > var explorerPath = explorerApp.mountpath || explorerApp.route;</span>
<span class="cstat-no" title="statement not covered" > console.log('Browse your REST API at %s%s', baseUrl, explorerPath);</span>
});
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jun 11 2015 21:16:17 GMT-0400 (EDT)</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

View File

@@ -0,0 +1,426 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for server/boot/fieldGuide.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../prettify.css">
<link rel="stylesheet" href="../../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header low">
<h1>Code coverage report for <span class="entity">server/boot/fieldGuide.js</span></h1>
<h2>
Statements: <span class="metric">24.14% <small>(14 / 58)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">0% <small>(0 / 24)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">9.09% <small>(1 / 11)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">25% <small>(14 / 56)</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">server/boot/</a> &#187; fieldGuide.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128</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-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">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<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-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<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-no">&nbsp;</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>
<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-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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></td><td class="text"><pre class="prettyprint lang-js">var R = require('ramda'),
// Rx = require('rx'),
// debug = require('debug')('freecc:fieldguides'),
utils = require('../utils');
&nbsp;
module.exports = function(app) {
var router = app.loopback.Router();
var FieldGuide = app.models.FieldGuide;
&nbsp;
router.get('/field-guide/all-articles', showAllFieldGuides);
router.get('/field-guide/:fieldGuideName', returnIndividualFieldGuide);
router.get('/field-guide/', returnNextFieldGuide);
router.post('/completed-field-guide/', completedFieldGuide);
&nbsp;
app.use(router);
&nbsp;
<span class="fstat-no" title="function not covered" > function returnIndividualFieldGuide(req, res, next) {</span>
<span class="cstat-no" title="statement not covered" > var dashedNameFromQuery = req.params.fieldGuideName;</span>
<span class="cstat-no" title="statement not covered" > if (req.user) {</span>
<span class="cstat-no" title="statement not covered" > var completed = req.user.completedFieldGuides;</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > var uncompletedFieldGuides = utils.allFieldGuideIds()</span>
.filter(<span class="fstat-no" title="function not covered" >function (elem) {</span>
<span class="cstat-no" title="statement not covered" > if (completed.indexOf(elem) === -1) {</span>
<span class="cstat-no" title="statement not covered" > return elem;</span>
}
});
<span class="cstat-no" title="statement not covered" > req.user.uncompletedFieldGuides = uncompletedFieldGuides;</span>
// TODO(berks): handle callback properly
<span class="cstat-no" title="statement not covered" > req.user.save(<span class="fstat-no" title="function not covered" >function(err) {</span></span>
<span class="cstat-no" title="statement not covered" > if (err) { <span class="cstat-no" title="statement not covered" >return next(err); </span>}</span>
});
}
&nbsp;
<span class="cstat-no" title="statement not covered" > FieldGuide.find({ where: {'dashedName': dashedNameFromQuery}},</span>
<span class="fstat-no" title="function not covered" > function(err, fieldGuideFromMongo) {</span>
<span class="cstat-no" title="statement not covered" > if (err) {</span>
<span class="cstat-no" title="statement not covered" > return next(err);</span>
}
&nbsp;
<span class="cstat-no" title="statement not covered" > if (fieldGuideFromMongo.length &lt; 1) {</span>
<span class="cstat-no" title="statement not covered" > req.flash('errors', {</span>
msg: '404: We couldn\'t find a field guide entry with that name. ' +
'Please double check the name.'
});
&nbsp;
<span class="cstat-no" title="statement not covered" > return res.redirect('/');</span>
}
&nbsp;
<span class="cstat-no" title="statement not covered" > var fieldGuide = R.head(fieldGuideFromMongo);</span>
<span class="cstat-no" title="statement not covered" > fieldGuide.name.toLowerCase().replace(/\s/g, '-').replace(/\?/g, '');</span>
&nbsp;
// if (fieldGuide.dashedName !== dashedNameFromQuery) {
// return res.redirect('../field-guide/' + fieldGuide.dashedName);
// }
<span class="cstat-no" title="statement not covered" > res.render('field-guide/show', {</span>
title: fieldGuide.name,
fieldGuideId: fieldGuide.id,
description: fieldGuide.description.join('')
});
}
);
}
&nbsp;
<span class="fstat-no" title="function not covered" > function showAllFieldGuides(req, res) {</span>
<span class="cstat-no" title="statement not covered" > var allFieldGuideNamesAndIds = utils.allFieldGuideNamesAndIds();</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > var completedFieldGuides = [];</span>
<span class="cstat-no" title="statement not covered" > if (req.user &amp;&amp; req.user.completedFieldGuides) {</span>
<span class="cstat-no" title="statement not covered" > completedFieldGuides = req.user.completedFieldGuides;</span>
}
<span class="cstat-no" title="statement not covered" > res.render('field-guide/all-articles', {</span>
allFieldGuideNamesAndIds: allFieldGuideNamesAndIds,
completedFieldGuides: completedFieldGuides
});
}
&nbsp;
<span class="fstat-no" title="function not covered" > function showCompletedFieldGuideFunction(req, res) {</span>
<span class="cstat-no" title="statement not covered" > req.flash('success', {</span>
msg: [
'You\'ve read all our current Field Guide entries. ' +
'If you have ideas for other Field Guide articles, ' +
'please let us know on ',
'&lt;a href=\'https://github.com/freecodecamp/freecodecamp/' +
'issues/new?&amp;body=Please describe your idea for a Field Guide' +
' article and include links if possible.\'&gt;GitHub&lt;/a&gt;.'
].join('')
});
<span class="cstat-no" title="statement not covered" > return res.redirect('../field-guide/how-do-i-use-this-guide');</span>
}
&nbsp;
<span class="fstat-no" title="function not covered" > function returnNextFieldGuide(req, res, next) {</span>
<span class="cstat-no" title="statement not covered" > if (!req.user) {</span>
<span class="cstat-no" title="statement not covered" > return res.redirect('/field-guide/how-do-i-use-this-guide');</span>
}
&nbsp;
<span class="cstat-no" title="statement not covered" > if (!req.user.uncompletedFieldGuides.length) {</span>
<span class="cstat-no" title="statement not covered" > return showCompletedFieldGuideFunction(req, res, next);</span>
}
&nbsp;
<span class="cstat-no" title="statement not covered" > FieldGuide.findById(req.user.uncompletedFieldGuides[0],</span>
<span class="fstat-no" title="function not covered" > function(err, fieldGuide) {</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > if (err) { <span class="cstat-no" title="statement not covered" >return next(err); </span>}</span>
<span class="cstat-no" title="statement not covered" > return res.redirect('../field-guide/' + fieldGuide.dashedName);</span>
});
}
};
&nbsp;
<span class="fstat-no" title="function not covered" >function completedFieldGuide(req, res, next) {</span>
<span class="cstat-no" title="statement not covered" > var fieldGuideId = req.body.fieldGuideInfo.fieldGuideId;</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > req.user.completedFieldGuides.push(fieldGuideId);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > var index = req.user.uncompletedFieldGuides.indexOf(fieldGuideId);</span>
<span class="cstat-no" title="statement not covered" > if (index &gt; -1) {</span>
<span class="cstat-no" title="statement not covered" > req.user.progressTimestamps.push(Date.now());</span>
<span class="cstat-no" title="statement not covered" > req.user.uncompletedFieldGuides.splice(index, 1);</span>
}
&nbsp;
<span class="cstat-no" title="statement not covered" > req.user.save(<span class="fstat-no" title="function not covered" >function (err) {</span></span>
<span class="cstat-no" title="statement not covered" > if (err) {</span>
<span class="cstat-no" title="statement not covered" > return next(err);</span>
}
<span class="cstat-no" title="statement not covered" > res.send(true);</span>
});
}
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jun 11 2015 21:16:17 GMT-0400 (EDT)</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

View File

@@ -0,0 +1,117 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for server/boot/home.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../prettify.css">
<link rel="stylesheet" href="../../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header medium">
<h1>Code coverage report for <span class="entity">server/boot/home.js</span></h1>
<h2>
Statements: <span class="metric">50% <small>(7 / 14)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">0% <small>(0 / 6)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">33.33% <small>(1 / 3)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">53.85% <small>(7 / 13)</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">server/boot/</a> &#187; home.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25</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-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">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var defaultProfileImage =
require('../../common/utils/constantStrings.json').defaultProfileImage;
var message =
'Learn to Code JavaScript and get a Coding Job by Helping Nonprofits';
&nbsp;
module.exports = function(app) {
var router = app.loopback.Router();
router.get('/', index);
&nbsp;
app.use(router);
&nbsp;
<span class="fstat-no" title="function not covered" > function index(req, res, next) {</span>
<span class="cstat-no" title="statement not covered" > if (req.user &amp;&amp; !req.user.picture) {</span>
<span class="cstat-no" title="statement not covered" > req.user.picture = defaultProfileImage;</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > req.user.save(<span class="fstat-no" title="function not covered" >function(err) {</span></span>
<span class="cstat-no" title="statement not covered" > if (err) { <span class="cstat-no" title="statement not covered" >return next(err); </span>}</span>
<span class="cstat-no" title="statement not covered" > res.render('home', { title: message });</span>
});
} else {
<span class="cstat-no" title="statement not covered" > res.render('home', { title: message });</span>
}
}
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jun 11 2015 21:16:17 GMT-0400 (EDT)</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

View File

@@ -0,0 +1,255 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for server/boot/</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../prettify.css">
<link rel="stylesheet" href="../../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header low">
<h1>Code coverage report for <span class="entity">server/boot/</span></h1>
<h2>
Statements: <span class="metric">20.49% <small>(218 / 1064)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">0.2% <small>(1 / 503)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">6.03% <small>(14 / 232)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">21.23% <small>(218 / 1027)</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; server/boot/</div>
</div>
<div class="body">
<div class="coverage-summary">
<table>
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file low" data-value="a-extendUser.js"><a href="a-extendUser.js.html">a-extendUser.js</a></td>
<td data-value="34.78" class="pic low"><span class="cover-fill" style="width: 34px;"></span><span class="cover-empty" style="width:66px;"></span></td>
<td data-value="34.78" class="pct low">34.78%</td>
<td data-value="23" class="abs low">(8&nbsp;/&nbsp;23)</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="8" class="abs low">(0&nbsp;/&nbsp;8)</td>
<td data-value="14.29" class="pct low">14.29%</td>
<td data-value="7" class="abs low">(1&nbsp;/&nbsp;7)</td>
<td data-value="36.36" class="pct low">36.36%</td>
<td data-value="22" class="abs low">(8&nbsp;/&nbsp;22)</td>
</tr>
<tr>
<td class="file high" data-value="authentication.js"><a href="authentication.js.html">authentication.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="2" class="abs high">(2&nbsp;/&nbsp;2)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">(0&nbsp;/&nbsp;0)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">(1&nbsp;/&nbsp;1)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">(2&nbsp;/&nbsp;2)</td>
</tr>
<tr>
<td class="file low" data-value="challenge.js"><a href="challenge.js.html">challenge.js</a></td>
<td data-value="10.71" class="pic low"><span class="cover-fill" style="width: 10px;"></span><span class="cover-empty" style="width:90px;"></span></td>
<td data-value="10.71" class="pct low">10.71%</td>
<td data-value="196" class="abs low">(21&nbsp;/&nbsp;196)</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="118" class="abs low">(0&nbsp;/&nbsp;118)</td>
<td data-value="2.78" class="pct low">2.78%</td>
<td data-value="36" class="abs low">(1&nbsp;/&nbsp;36)</td>
<td data-value="11.05" class="pct low">11.05%</td>
<td data-value="190" class="abs low">(21&nbsp;/&nbsp;190)</td>
</tr>
<tr>
<td class="file low" data-value="challengeMap.js"><a href="challengeMap.js.html">challengeMap.js</a></td>
<td data-value="32.26" class="pic low"><span class="cover-fill" style="width: 32px;"></span><span class="cover-empty" style="width:68px;"></span></td>
<td data-value="32.26" class="pct low">32.26%</td>
<td data-value="31" class="abs low">(10&nbsp;/&nbsp;31)</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="4" class="abs low">(0&nbsp;/&nbsp;4)</td>
<td data-value="11.11" class="pct low">11.11%</td>
<td data-value="9" class="abs low">(1&nbsp;/&nbsp;9)</td>
<td data-value="33.33" class="pct low">33.33%</td>
<td data-value="30" class="abs low">(10&nbsp;/&nbsp;30)</td>
</tr>
<tr>
<td class="file medium" data-value="explorer.js"><a href="explorer.js.html">explorer.js</a></td>
<td data-value="56.25" class="pic medium"><span class="cover-fill" style="width: 56px;"></span><span class="cover-empty" style="width:44px;"></span></td>
<td data-value="56.25" class="pct medium">56.25%</td>
<td data-value="16" class="abs medium">(9&nbsp;/&nbsp;16)</td>
<td data-value="25" class="pct low">25%</td>
<td data-value="4" class="abs low">(1&nbsp;/&nbsp;4)</td>
<td data-value="33.33" class="pct low">33.33%</td>
<td data-value="3" class="abs low">(1&nbsp;/&nbsp;3)</td>
<td data-value="56.25" class="pct medium">56.25%</td>
<td data-value="16" class="abs medium">(9&nbsp;/&nbsp;16)</td>
</tr>
<tr>
<td class="file low" data-value="fieldGuide.js"><a href="fieldGuide.js.html">fieldGuide.js</a></td>
<td data-value="24.14" class="pic low"><span class="cover-fill" style="width: 24px;"></span><span class="cover-empty" style="width:76px;"></span></td>
<td data-value="24.14" class="pct low">24.14%</td>
<td data-value="58" class="abs low">(14&nbsp;/&nbsp;58)</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="24" class="abs low">(0&nbsp;/&nbsp;24)</td>
<td data-value="9.09" class="pct low">9.09%</td>
<td data-value="11" class="abs low">(1&nbsp;/&nbsp;11)</td>
<td data-value="25" class="pct low">25%</td>
<td data-value="56" class="abs low">(14&nbsp;/&nbsp;56)</td>
</tr>
<tr>
<td class="file medium" data-value="home.js"><a href="home.js.html">home.js</a></td>
<td data-value="50" class="pic medium"><span class="cover-fill" style="width: 50px;"></span><span class="cover-empty" style="width:50px;"></span></td>
<td data-value="50" class="pct medium">50%</td>
<td data-value="14" class="abs medium">(7&nbsp;/&nbsp;14)</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="6" class="abs low">(0&nbsp;/&nbsp;6)</td>
<td data-value="33.33" class="pct low">33.33%</td>
<td data-value="3" class="abs low">(1&nbsp;/&nbsp;3)</td>
<td data-value="53.85" class="pct medium">53.85%</td>
<td data-value="13" class="abs medium">(7&nbsp;/&nbsp;13)</td>
</tr>
<tr>
<td class="file medium" data-value="jobs.js"><a href="jobs.js.html">jobs.js</a></td>
<td data-value="60" class="pic medium"><span class="cover-fill" style="width: 60px;"></span><span class="cover-empty" style="width:40px;"></span></td>
<td data-value="60" class="pct medium">60%</td>
<td data-value="10" class="abs medium">(6&nbsp;/&nbsp;10)</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="2" class="abs low">(0&nbsp;/&nbsp;2)</td>
<td data-value="33.33" class="pct low">33.33%</td>
<td data-value="3" class="abs low">(1&nbsp;/&nbsp;3)</td>
<td data-value="66.67" class="pct medium">66.67%</td>
<td data-value="9" class="abs medium">(6&nbsp;/&nbsp;9)</td>
</tr>
<tr>
<td class="file high" data-value="middlewares.js"><a href="middlewares.js.html">middlewares.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="0" class="abs high">(0&nbsp;/&nbsp;0)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">(0&nbsp;/&nbsp;0)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">(0&nbsp;/&nbsp;0)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">(0&nbsp;/&nbsp;0)</td>
</tr>
<tr>
<td class="file low" data-value="nonprofits.js"><a href="nonprofits.js.html">nonprofits.js</a></td>
<td data-value="24.24" class="pic low"><span class="cover-fill" style="width: 24px;"></span><span class="cover-empty" style="width:76px;"></span></td>
<td data-value="24.24" class="pct low">24.24%</td>
<td data-value="33" class="abs low">(8&nbsp;/&nbsp;33)</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="16" class="abs low">(0&nbsp;/&nbsp;16)</td>
<td data-value="16.67" class="pct low">16.67%</td>
<td data-value="6" class="abs low">(1&nbsp;/&nbsp;6)</td>
<td data-value="25" class="pct low">25%</td>
<td data-value="32" class="abs low">(8&nbsp;/&nbsp;32)</td>
</tr>
<tr>
<td class="file low" data-value="randomAPIs.js"><a href="randomAPIs.js.html">randomAPIs.js</a></td>
<td data-value="28.92" class="pic low"><span class="cover-fill" style="width: 28px;"></span><span class="cover-empty" style="width:72px;"></span></td>
<td data-value="28.92" class="pct low">28.92%</td>
<td data-value="166" class="abs low">(48&nbsp;/&nbsp;166)</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="60" class="abs low">(0&nbsp;/&nbsp;60)</td>
<td data-value="2.13" class="pct low">2.13%</td>
<td data-value="47" class="abs low">(1&nbsp;/&nbsp;47)</td>
<td data-value="29.81" class="pct low">29.81%</td>
<td data-value="161" class="abs low">(48&nbsp;/&nbsp;161)</td>
</tr>
<tr>
<td class="file medium" data-value="redirects.js"><a href="redirects.js.html">redirects.js</a></td>
<td data-value="66.67" class="pic medium"><span class="cover-fill" style="width: 66px;"></span><span class="cover-empty" style="width:34px;"></span></td>
<td data-value="66.67" class="pct medium">66.67%</td>
<td data-value="9" class="abs medium">(6&nbsp;/&nbsp;9)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">(0&nbsp;/&nbsp;0)</td>
<td data-value="25" class="pct low">25%</td>
<td data-value="4" class="abs low">(1&nbsp;/&nbsp;4)</td>
<td data-value="66.67" class="pct medium">66.67%</td>
<td data-value="9" class="abs medium">(6&nbsp;/&nbsp;9)</td>
</tr>
<tr>
<td class="file high" data-value="restApi.js"><a href="restApi.js.html">restApi.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="3" class="abs high">(3&nbsp;/&nbsp;3)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">(0&nbsp;/&nbsp;0)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">(1&nbsp;/&nbsp;1)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">(3&nbsp;/&nbsp;3)</td>
</tr>
<tr>
<td class="file low" data-value="story.js"><a href="story.js.html">story.js</a></td>
<td data-value="16.28" class="pic low"><span class="cover-fill" style="width: 16px;"></span><span class="cover-empty" style="width:84px;"></span></td>
<td data-value="16.28" class="pct low">16.28%</td>
<td data-value="215" class="abs low">(35&nbsp;/&nbsp;215)</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="111" class="abs low">(0&nbsp;/&nbsp;111)</td>
<td data-value="2.5" class="pct low">2.5%</td>
<td data-value="40" class="abs low">(1&nbsp;/&nbsp;40)</td>
<td data-value="16.43" class="pct low">16.43%</td>
<td data-value="213" class="abs low">(35&nbsp;/&nbsp;213)</td>
</tr>
<tr>
<td class="file low" data-value="user.js"><a href="user.js.html">user.js</a></td>
<td data-value="14.24" class="pic low"><span class="cover-fill" style="width: 14px;"></span><span class="cover-empty" style="width:86px;"></span></td>
<td data-value="14.24" class="pct low">14.24%</td>
<td data-value="288" class="abs low">(41&nbsp;/&nbsp;288)</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="150" class="abs low">(0&nbsp;/&nbsp;150)</td>
<td data-value="1.64" class="pct low">1.64%</td>
<td data-value="61" class="abs low">(1&nbsp;/&nbsp;61)</td>
<td data-value="15.13" class="pct low">15.13%</td>
<td data-value="271" class="abs low">(41&nbsp;/&nbsp;271)</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 Thu Jun 11 2015 21:16:17 GMT-0400 (EDT)</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

View File

@@ -0,0 +1,99 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for server/boot/jobs.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../prettify.css">
<link rel="stylesheet" href="../../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header medium">
<h1>Code coverage report for <span class="entity">server/boot/jobs.js</span></h1>
<h2>
Statements: <span class="metric">60% <small>(6 / 10)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">0% <small>(0 / 2)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">33.33% <small>(1 / 3)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">66.67% <small>(6 / 9)</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">server/boot/</a> &#187; jobs.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19</td><td class="line-coverage"><span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<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-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function(app) {
var Job = app.models.Job;
var router = app.loopback.Router();
&nbsp;
router.get('/jobs', jobsDirectory);
app.use(router);
&nbsp;
<span class="fstat-no" title="function not covered" > function jobsDirectory(req, res, next) {</span>
<span class="cstat-no" title="statement not covered" > Job.find({}, <span class="fstat-no" title="function not covered" >function(err, jobs) {</span></span>
<span class="cstat-no" title="statement not covered" > if (err) { <span class="cstat-no" title="statement not covered" >return next(err); </span>}</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > res.render('jobs/directory', {</span>
title: 'Junior JavaScript Engineer Jobs',
jobs: jobs
});
});
}
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jun 11 2015 21:16:17 GMT-0400 (EDT)</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

View File

@@ -0,0 +1,45 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for server/boot/middlewares.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../prettify.css">
<link rel="stylesheet" href="../../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">server/boot/middlewares.js</span></h1>
<h2>
Statements: <span class="metric">100% <small>(0 / 0)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">100% <small>(0 / 0)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(0 / 0)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">100% <small>(0 / 0)</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">server/boot/</a> &#187; middlewares.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jun 11 2015 21:16:17 GMT-0400 (EDT)</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

View File

@@ -0,0 +1,432 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for server/boot/nonprofits.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../prettify.css">
<link rel="stylesheet" href="../../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header low">
<h1>Code coverage report for <span class="entity">server/boot/nonprofits.js</span></h1>
<h2>
Statements: <span class="metric">24.24% <small>(8 / 33)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">0% <small>(0 / 16)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">16.67% <small>(1 / 6)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">25% <small>(8 / 32)</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">server/boot/</a> &#187; nonprofits.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130</td><td class="line-coverage"><span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<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-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</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>
<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-neutral">&nbsp;</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>
<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-neutral">&nbsp;</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>
<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-neutral">&nbsp;</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>
<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-neutral">&nbsp;</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>
<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-neutral">&nbsp;</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>
<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-neutral">&nbsp;</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>
<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-neutral">&nbsp;</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>
<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-neutral">&nbsp;</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>
<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-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function(app) {
var router = app.loopback.Router();
var Nonprofit = app.models.Nonprofit;
&nbsp;
router.get('/nonprofits/directory', nonprofitsDirectory);
router.get('/nonprofits/:nonprofitName', returnIndividualNonprofit);
&nbsp;
app.use(router);
&nbsp;
<span class="fstat-no" title="function not covered" > function nonprofitsDirectory(req, res, next) {</span>
<span class="cstat-no" title="statement not covered" > Nonprofit.find(</span>
{ where: { estimatedHours: { $gt: 0 } } },
<span class="fstat-no" title="function not covered" > function(err, nonprofits) {</span>
<span class="cstat-no" title="statement not covered" > if (err) { <span class="cstat-no" title="statement not covered" >return next(err); </span>}</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > res.render('nonprofits/directory', {</span>
title: 'Nonprofits we help',
nonprofits: nonprofits
});
}
);
}
&nbsp;
<span class="fstat-no" title="function not covered" > function returnIndividualNonprofit(req, res, next) {</span>
<span class="cstat-no" title="statement not covered" > var dashedName = req.params.nonprofitName;</span>
<span class="cstat-no" title="statement not covered" > var nonprofitName = dashedName.replace(/\-/g, ' ');</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > Nonprofit.find(</span>
{ where: { name: new RegExp(nonprofitName, 'i') } },
<span class="fstat-no" title="function not covered" > function(err, nonprofit) {</span>
<span class="cstat-no" title="statement not covered" > if (err) {</span>
<span class="cstat-no" title="statement not covered" > return next(err);</span>
}
&nbsp;
<span class="cstat-no" title="statement not covered" > if (nonprofit.length &lt; 1) {</span>
<span class="cstat-no" title="statement not covered" > req.flash('errors', {</span>
msg: "404: We couldn't find a nonprofit with that name. " +
'Please double check the name.'
});
&nbsp;
<span class="cstat-no" title="statement not covered" > return res.redirect('/nonprofits');</span>
}
&nbsp;
<span class="cstat-no" title="statement not covered" > nonprofit = nonprofit.pop();</span>
<span class="cstat-no" title="statement not covered" > var dashedNameFull = nonprofit.name.toLowerCase().replace(/\s/g, '-');</span>
<span class="cstat-no" title="statement not covered" > if (dashedNameFull !== dashedName) {</span>
<span class="cstat-no" title="statement not covered" > return res.redirect('../nonprofit/' + dashedNameFull);</span>
}
<span class="cstat-no" title="statement not covered" > var buttonActive = false;</span>
<span class="cstat-no" title="statement not covered" > if (req.user) {</span>
<span class="cstat-no" title="statement not covered" > if (req.user.uncompletedBonfires.length === 0) {</span>
<span class="cstat-no" title="statement not covered" > if (req.user.completedCoursewares.length &gt; 63) {</span>
<span class="cstat-no" title="statement not covered" > var hasShownInterest =</span>
nonprofit.interestedCampers.filter(<span class="fstat-no" title="function not covered" >function ( obj ) {</span>
<span class="cstat-no" title="statement not covered" > return obj.username === req.user.username;</span>
});
&nbsp;
<span class="cstat-no" title="statement not covered" > if (hasShownInterest.length === 0) {</span>
<span class="cstat-no" title="statement not covered" > buttonActive = true;</span>
}
}
}
}
&nbsp;
<span class="cstat-no" title="statement not covered" > res.render('nonprofits/show', {</span>
dashedName: dashedNameFull,
title: nonprofit.name,
logoUrl: nonprofit.logoUrl,
estimatedHours: nonprofit.estimatedHours,
projectDescription: nonprofit.projectDescription,
&nbsp;
approvedOther:
nonprofit.approvedDeliverables.indexOf('other') &gt; -1,
approvedWebsite:
nonprofit.approvedDeliverables.indexOf('website') &gt; -1,
&nbsp;
approvedDonor:
nonprofit.approvedDeliverables.indexOf('donor') &gt; -1,
approvedInventory:
nonprofit.approvedDeliverables.indexOf('inventory') &gt; -1,
&nbsp;
approvedVolunteer:
nonprofit.approvedDeliverables.indexOf('volunteer') &gt; -1,
approvedForm:
nonprofit.approvedDeliverables.indexOf('form') &gt; -1,
&nbsp;
approvedCommunity:
nonprofit.approvedDeliverables.indexOf('community') &gt; -1,
approvedELearning:
nonprofit.approvedDeliverables.indexOf('eLearning') &gt; -1,
&nbsp;
websiteLink: nonprofit.websiteLink,
imageUrl: nonprofit.imageUrl,
whatDoesNonprofitDo: nonprofit.whatDoesNonprofitDo,
interestedCampers: nonprofit.interestedCampers,
assignedCampers: nonprofit.assignedCampers,
buttonActive: buttonActive,
currentStatus: nonprofit.currentStatus
});
}
);
}
&nbsp;
/*
function interestedInNonprofit(req, res, next) {
if (req.user) {
Nonprofit.findOne(
{ name: new RegExp(req.params.nonprofitName.replace(/-/, ' '), 'i') },
function(err, nonprofit) {
if (err) { return next(err); }
nonprofit.interestedCampers.push({
username: req.user.username,
picture: req.user.picture,
timeOfInterest: Date.now()
});
nonprofit.save(function(err) {
if (err) { return next(err); }
req.flash('success', {
msg: 'Thanks for expressing interest in this nonprofit project! ' +
"We've added you to this project as an interested camper!"
});
res.redirect('back');
});
}
);
}
}
*/
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jun 11 2015 21:16:17 GMT-0400 (EDT)</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,111 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for server/boot/redirects.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../prettify.css">
<link rel="stylesheet" href="../../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header medium">
<h1>Code coverage report for <span class="entity">server/boot/redirects.js</span></h1>
<h2>
Statements: <span class="metric">66.67% <small>(6 / 9)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">100% <small>(0 / 0)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">25% <small>(1 / 4)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">66.67% <small>(6 / 9)</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">server/boot/</a> &#187; redirects.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23</td><td class="line-coverage"><span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</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>
<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-no">&nbsp;</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-no">&nbsp;</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>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function(app) {
var router = app.loopback.Router();
&nbsp;
router.get('/nonprofit-project-instructions', <span class="fstat-no" title="function not covered" >function(req, res) {</span>
<span class="cstat-no" title="statement not covered" > res.redirect(</span>
301,
'/field-guide/how-do-free-code-camps-nonprofit-projects-work'
);
});
&nbsp;
router.get('/agile', <span class="fstat-no" title="function not covered" >function(req, res) {</span>
<span class="cstat-no" title="statement not covered" > res.redirect(301, '/pmi-acp-agile-project-managers');</span>
});
&nbsp;
router.get('/privacy', <span class="fstat-no" title="function not covered" >function(req, res) {</span>
<span class="cstat-no" title="statement not covered" > res.redirect(</span>
301, '/field-guide/what-is-the-free-code-camp-privacy-policy?'
);
});
&nbsp;
app.use(router);
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jun 11 2015 21:16:17 GMT-0400 (EDT)</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

View File

@@ -0,0 +1,57 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for server/boot/restApi.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../prettify.css">
<link rel="stylesheet" href="../../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">server/boot/restApi.js</span></h1>
<h2>
Statements: <span class="metric">100% <small>(3 / 3)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">100% <small>(0 / 0)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(1 / 1)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">100% <small>(3 / 3)</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">server/boot/</a> &#187; restApi.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5</td><td class="line-coverage"><span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">module.exports = function mountRestApi(app) {
var restApiRoot = app.get('restApiRoot');
app.use(restApiRoot, app.loopback.rest());
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jun 11 2015 21:16:17 GMT-0400 (EDT)</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff