smartenv/coverage/lcov-report/dist/smartenv.environment.js.html

234 lines
12 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for dist/smartenv.environment.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../index.html">all files</a> / <a href="index.html">dist/</a> smartenv.environment.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">86.67% </span>
<span class="quiet">Statements</span>
<span class='fraction'>26/30</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">62.5% </span>
<span class="quiet">Branches</span>
<span class='fraction'>5/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">86.67% </span>
<span class="quiet">Lines</span>
<span class='fraction'>26/30</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">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</td><td class="line-coverage quiet"><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-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-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">4×</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-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-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-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">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</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-yes">2×</span>
<span class="cline-any cline-yes">2×</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-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">#!/usr/bin/env node
&nbsp;
/// &lt;reference path="typings/main.d.ts" /&gt;
/**
* Deals with the environment the current JS script is running in.
*/
var plugins = require("./smartenv.plugins");
var SmartenvClasses = require("./smartenv.classes");
var SmartenvObjectStorage = require("./smartenv.objectstorage");
var environment;
var envDetermined = false;
/**
* returns the environment
* @returns {Environment}
*/
var getEnv = function () {
if (!envDetermined) {
(function () {
var localRunTimeEnv = "undefined";
var localUserAgent = "undefined";
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof window !== "undefined") {
<span class="cstat-no" title="statement not covered" > localRunTimeEnv = 'browser';</span>
<span class="cstat-no" title="statement not covered" > localUserAgent = navigator.userAgent;</span>
}
else <span class="missing-if-branch" title="else path not taken" >E</span>if (typeof process !== "undefined") {
localRunTimeEnv = 'node';
}
environment = new SmartenvClasses.Environment(localRunTimeEnv, localUserAgent);
})();
envDetermined = true; // ensure code above only runs once
}
;
return environment;
};
/**
* prints the environment to console
*/
var printEnv = function () {
<span class="missing-if-branch" title="else path not taken" >E</span>if (this.getEnv().isNode) {
plugins.beautylog.ok("running on NODE");
var smartenvVersion = require("../package.json").version;
plugins.beautylog.log("node version is " + this.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
}
else {
<span class="cstat-no" title="statement not covered" > plugins.beautylog.ok("running on BROWSER");</span>
<span class="cstat-no" title="statement not covered" > plugins.beautylog.log("browser is " + this.getEnv().userAgent);</span>
}
plugins.beautylog.log("the smartenv registration store currently holds the following properties:");
console.log(Object.getOwnPropertyNames(SmartenvObjectStorage.obs.getAll()));
};
exports.init = function (objectArg) {
objectArg.getEnv = getEnv;
objectArg.printEnv = printEnv;
};
&nbsp;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0ZW52LmVudmlyb25tZW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nYoKS51c2VyQWdlbnQpO1xuICAgIH1cbiAgICBwbHVnaW5zLmJlYXV0eWxvZy5sb2coXCJ0aGUgc21hcnRlbnYgcmVnaXN0cmF0aW9uIHN0b3JlIGN1cnJlbnRseSBob2xkcyB0aGUgZm9sbG93aW5nIHByb3BlcnRpZXM6XCIpO1xuICAgIGNvbnNvbGUubG9nKE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzKFNtYXJ0ZW52T2JqZWN0U3RvcmFnZS5vYnMuZ2V0QWxsKCkpKTtcbn07XG5cbmV4cG9ydCB2YXIgaW5pdCA9IGZ1bmN0aW9uKG9iamVjdEFyZykge1xuICAgIG9iamVjdEFyZy5nZXRFbnYgPSBnZXRFbnY7XG4gICAgb2JqZWN0QXJnLnByaW50RW52ID0gcHJpbnRFbnY7XG59OyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Feb 17 2016 21:43:50 GMT+0100 (CET)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>