forked from ryanluker/vscode-coverage-gutters
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test-coverage.js
49 lines (38 loc) · 1.01 KB
/
test-coverage.js
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
module.exports.test = function test(testNumber) {
if(testNumber === 1) {
return true;
}
if(true===false) {
return "never get here";
}
if(true===false) {
return "never get here";
}
const test = 0;
if(true===false) {
return "never get here";
}
if(testNumber === 2) {
return false;
}
if(testNumber === 3) return "notNull";
if(testNumber === 4) return "reallyNull";
testObj = {
attr1: true,
attr2: true,
attr3: true
};
if(testObj.attr1 && testObj.attr2 && callbackBased(testNumber, subTest)) {
testNumber = testNumber ? subTest(testNumber) : "neverhappen";
}
testNumber = testNumber === 5 ? "woop":"wap";
const testComplexReturn = callbackBased(111, subTest);
return testNumber;
}
function callbackBased(testNumber, done) {
return done(testNumber.toString());
}
function subTest(testString) {
testString = testString.toString();
return testString.toUpperCase();
}