json-mock
Version:
Mock a REST API using just JSON. An advanced fork of typicode/json-server
130 lines (128 loc) • 4.17 kB
HTML
<html lang="en">
<head>
<title>Code coverage report for src/defaults.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">src/defaults.js</span></h1>
<h2>
Statements: <span class="metric">86.67% <small>(13 / 15)</small></span>
Branches: <span class="metric">50% <small>(2 / 4)</small></span>
Functions: <span class="metric">100% <small>(1 / 1)</small></span>
Lines: <span class="metric">86.67% <small>(13 / 15)</small></span>
Ignored: <span class="metric"><span class="ignore-none">none</span></span>
</h2>
<div class="path"><a href="../index.html">All files</a> » <a href="index.html">src/</a> » defaults.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</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-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">28</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1</span></td><td class="text"><pre class="prettyprint lang-js">var fs = require('fs')
var express = require('express')
var logger = require('morgan')
var cors = require('cors')
var errorhandler = require('errorhandler')
var arr = []
// Logger
arr.push(logger('dev', {
skip: function(req, res) { return req.path === '/favicon.ico' }
}))
// Serve static files
<span class="missing-if-branch" title="if path not taken" >I</span>if (fs.existsSync(process.cwd() + '/public')) {
<span class="cstat-no" title="statement not covered" > arr.push(express.static(process.cwd() + '/public'));</span>
} else {
arr.push(express.static(__dirname + '/public'));
}
// CORS
arr.push(cors({ origin: true, credentials: true }))
<span class="missing-if-branch" title="if path not taken" >I</span>if (process.env.NODE_ENV === 'development') {
// only use in development
<span class="cstat-no" title="statement not covered" > arr.push(errorhandler())</span>
}
module.exports = arr</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 Wed May 06 2015 13:09:01 GMT-0600 (MDT)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>