Skip to content

Commit 2fd201f

Browse files
author
Kamesh
committed
pushing to master and checking
2 parents 4884742 + 1f31570 commit 2fd201f

File tree

12 files changed

+1330
-195
lines changed

12 files changed

+1330
-195
lines changed

coverage/clover.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<coverage generated="1523967155105" clover="3.2.0">
3-
<project timestamp="1523967155105" name="All files">
2+
<coverage generated="1523982985380" clover="3.2.0">
3+
<project timestamp="1523982985380" name="All files">
44
<metrics statements="58" coveredstatements="58" conditionals="14" coveredconditionals="14" methods="11" coveredmethods="11" elements="83" coveredelements="83" complexity="0" loc="58" ncloc="58" packages="1" files="5" classes="5">
55
<file name="form_validator.js" path="/Volumes/HD_II/Personal/Learning/nodejs/es6/express-app-testing-demo/app/form_validator.js">
66
<metrics statements="5" coveredstatements="5" conditionals="4" coveredconditionals="4" methods="3" coveredmethods="3"/>

coverage/lcov-report/app.js.html

Lines changed: 0 additions & 140 deletions
This file was deleted.

coverage/lcov-report/form_validator.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ <h1>
109109
</div><!-- /wrapper -->
110110
<div class='footer quiet pad2 space-top1 center small'>
111111
Code coverage
112-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 17:42:35 GMT+0530 (IST)
112+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 22:06:25 GMT+0530 (IST)
113113
</div>
114114
</div>
115115
<script src="prettify.js"></script>

coverage/lcov-report/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ <h1>
132132
</div><!-- /wrapper -->
133133
<div class='footer quiet pad2 space-top1 center small'>
134134
Code coverage
135-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 17:42:35 GMT+0530 (IST)
135+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 22:06:25 GMT+0530 (IST)
136136
</div>
137137
</div>
138138
<script src="prettify.js"></script>

coverage/lcov-report/jsonp_helper.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ <h1>
109109
</div><!-- /wrapper -->
110110
<div class='footer quiet pad2 space-top1 center small'>
111111
Code coverage
112-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 17:42:35 GMT+0530 (IST)
112+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 22:06:25 GMT+0530 (IST)
113113
</div>
114114
</div>
115115
<script src="prettify.js"></script>

coverage/lcov-report/photo_model.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ <h1>
139139
</div><!-- /wrapper -->
140140
<div class='footer quiet pad2 space-top1 center small'>
141141
Code coverage
142-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 17:42:35 GMT+0530 (IST)
142+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 22:06:25 GMT+0530 (IST)
143143
</div>
144144
</div>
145145
<script src="prettify.js"></script>

coverage/lcov-report/route.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ <h1>
178178
</div><!-- /wrapper -->
179179
<div class='footer quiet pad2 space-top1 center small'>
180180
Code coverage
181-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 17:42:35 GMT+0530 (IST)
181+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 22:06:25 GMT+0530 (IST)
182182
</div>
183183
</div>
184184
<script src="prettify.js"></script>

coverage/lcov-report/server.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ <h1>
127127
</div><!-- /wrapper -->
128128
<div class='footer quiet pad2 space-top1 center small'>
129129
Code coverage
130-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 17:42:35 GMT+0530 (IST)
130+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 22:06:25 GMT+0530 (IST)
131131
</div>
132132
</div>
133133
<script src="prettify.js"></script>

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"main": "app/server.js",
1010
"scripts": {
1111
"start": "nodemon app/server.js",
12-
"test": "npm run lint && npm run jest",
12+
"test": "yarn run jest",
1313
"test:e2e": "jest --runInBand e2e_tests/*.test.js",
1414
"jest": "jest --no-watchman --coverage app/__tests__/*.test.js",
1515
"lint": "eslint app/** e2e_tests/*",
@@ -24,6 +24,7 @@
2424
"devDependencies": {
2525
"eslint": "^4.12.1",
2626
"jest": "^21.2.1",
27+
"jest-jenkins-reporter": "^1.0.1",
2728
"nodemon": "^1.12.5",
2829
"prettier": "^1.9.1",
2930
"supertest": "~3.0.0"
@@ -33,9 +34,15 @@
3334
"url": "https://github.com/gregjopa/express-app-testing-demo"
3435
},
3536
"jest": {
37+
"testResultsProcessor": "jest-jenkins-reporter",
3638
"testEnvironment": "node",
3739
"verbose": true
3840
},
41+
"jestSonar": {
42+
"reportPath": "reports",
43+
"reportFile": "report.xml",
44+
"indent": 4
45+
},
3946
"prettier": {
4047
"singleQuote": true
4148
}

reports/report.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<testsuites version="1">
3+
<testsuite name="index route" tests="4" failures="0" errors="0" timestamp="2018-04-17T16:36:25.386Z" time="0.038000000000000006">
4+
<testcase classname="index route" name="index route should respond with a 200 with no query parameters" time="0.027"/>
5+
<testcase classname="index route" name="index route should respond with a 200 with valid query parameters" time="0.005"/>
6+
<testcase classname="index route" name="index route should respond with a 200 with invalid query parameters" time="0.003"/>
7+
<testcase classname="index route" name="index route should respond with a 500 error due to bad jsonp data" time="0.003"/>
8+
</testsuite>
9+
<testsuite name="getFlickrPhotos(tags, tagmode, callback)" tests="3" failures="0" errors="0" timestamp="2018-04-17T16:36:25.386Z" time="0.006">
10+
<testcase classname="getFlickrPhotos(tags, tagmode, callback)" name="getFlickrPhotos(tags, tagmode, callback) should return photos" time="0.005"/>
11+
<testcase classname="getFlickrPhotos(tags, tagmode, callback)" name="getFlickrPhotos(tags, tagmode, callback) should error when api returns 500 http status code" time="0"/>
12+
<testcase classname="getFlickrPhotos(tags, tagmode, callback)" name="getFlickrPhotos(tags, tagmode, callback) should error with invalid jsonp data" time="0.001"/>
13+
</testsuite>
14+
<testsuite name="hasValidFlickrAPIParams(tags, tagmode)" tests="10" failures="0" errors="0" timestamp="2018-04-17T16:36:25.386Z" time="0.003">
15+
<testcase classname="isValidCommaDelimitedList(value)" name="isValidCommaDelimitedList(value) should return true for valid list of search terms" time="0.001"/>
16+
<testcase classname="isValidCommaDelimitedList(value)" name="isValidCommaDelimitedList(value) should return true for valid single search term" time="0"/>
17+
<testcase classname="isValidCommaDelimitedList(value)" name="isValidCommaDelimitedList(value) should return false for search term containing numbers" time="0.001"/>
18+
<testcase classname="isValidCommaDelimitedList(value)" name="isValidCommaDelimitedList(value) should return false for search term containing special characters" time="0"/>
19+
<testcase classname="isValidTagmode(value)" name="isValidTagmode(value) should return true for valid tagmode &quot;any&quot;" time="0"/>
20+
<testcase classname="isValidTagmode(value)" name="isValidTagmode(value) should return true for valid tagmode &quot;all&quot;" time="0"/>
21+
<testcase classname="isValidTagmode(value)" name="isValidTagmode(value) should return false for invalid tagmode" time="0"/>
22+
<testcase classname="hasValidFlickrAPIParams(tags, tagmode)" name="hasValidFlickrAPIParams(tags, tagmode) should return true for valid params" time="0.001"/>
23+
<testcase classname="hasValidFlickrAPIParams(tags, tagmode)" name="hasValidFlickrAPIParams(tags, tagmode) should return false for invalid tags" time="0"/>
24+
<testcase classname="hasValidFlickrAPIParams(tags, tagmode)" name="hasValidFlickrAPIParams(tags, tagmode) should return false for invalid tagmode" time="0"/>
25+
</testsuite>
26+
<testsuite name="parseJSONP(jsonpData)" tests="3" failures="0" errors="0" timestamp="2018-04-17T16:36:25.386Z" time="0.002">
27+
<testcase classname="parseJSONP(jsonpData)" name="parseJSONP(jsonpData) should parse valid jsonp data" time="0.001"/>
28+
<testcase classname="parseJSONP(jsonpData)" name="parseJSONP(jsonpData) should parse jsonp data with escaped single quotes" time="0"/>
29+
<testcase classname="parseJSONP(jsonpData)" name="parseJSONP(jsonpData) should throw error when parsing invalid jsonp data" time="0.001"/>
30+
</testsuite>
31+
</testsuites>

0 commit comments

Comments
 (0)