Skip to content

Commit 3afc37d

Browse files
author
Kamesh
committed
Added reporter
1 parent 22da978 commit 3afc37d

File tree

12 files changed

+1331
-56
lines changed

12 files changed

+1331
-56
lines changed

app/__tests__/app.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('index route', () => {
1515
.expect(200)
1616
.then(response => {
1717
expect(response.text).toMatch(
18-
/<title>Epress App Testing Demo<\/title>/
18+
/<title>Express App Testing Demo<\/title>/
1919
);
2020
});
2121
});

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="1523359626358" clover="3.2.0">
3-
<project timestamp="1523359626358" name="All files">
2+
<coverage generated="1523979499739" clover="3.2.0">
3+
<project timestamp="1523979499739" 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/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 10 2018 16:57:06 GMT+0530 (IST)
112+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 21:08:19 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 10 2018 16:57:06 GMT+0530 (IST)
135+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 21:08:19 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 10 2018 16:57:06 GMT+0530 (IST)
112+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 21:08:19 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 10 2018 16:57:06 GMT+0530 (IST)
142+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 21:08:19 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 10 2018 16:57:06 GMT+0530 (IST)
181+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 21:08:19 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 10 2018 16:57:06 GMT+0530 (IST)
130+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Apr 17 2018 21:08:19 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
@@ -11,7 +11,7 @@
1111
"start": "nodemon app/server.js",
1212
"test": "yarn run jest",
1313
"test:e2e": "jest --runInBand e2e_tests/*.test.js",
14-
"jest": "jest --no-watchman --coverage app/__tests__/*.test.js",
14+
"jest": "jest --colors --no-watchman --coverage app/__tests__/*.test.js",
1515
"lint": "eslint app/** e2e_tests/*",
1616
"prettier": "prettier --write app/*.js app/__{tests,mocks}__/*.js e2e_tests/*.js"
1717
},
@@ -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="parseJSONP(jsonpData)" tests="3" failures="0" errors="0" timestamp="2018-04-17T15:38:19.745Z" time="0.003">
4+
<testcase classname="parseJSONP(jsonpData)" name="parseJSONP(jsonpData) should parse valid jsonp data" time="0.003"/>
5+
<testcase classname="parseJSONP(jsonpData)" name="parseJSONP(jsonpData) should parse jsonp data with escaped single quotes" time="0"/>
6+
<testcase classname="parseJSONP(jsonpData)" name="parseJSONP(jsonpData) should throw error when parsing invalid jsonp data" time="0"/>
7+
</testsuite>
8+
<testsuite name="hasValidFlickrAPIParams(tags, tagmode)" tests="10" failures="0" errors="0" timestamp="2018-04-17T15:38:19.746Z" time="0.004">
9+
<testcase classname="isValidCommaDelimitedList(value)" name="isValidCommaDelimitedList(value) should return true for valid list of search terms" time="0.003"/>
10+
<testcase classname="isValidCommaDelimitedList(value)" name="isValidCommaDelimitedList(value) should return true for valid single search term" time="0"/>
11+
<testcase classname="isValidCommaDelimitedList(value)" name="isValidCommaDelimitedList(value) should return false for search term containing numbers" time="0"/>
12+
<testcase classname="isValidCommaDelimitedList(value)" name="isValidCommaDelimitedList(value) should return false for search term containing special characters" time="0"/>
13+
<testcase classname="isValidTagmode(value)" name="isValidTagmode(value) should return true for valid tagmode &quot;any&quot;" time="0.001"/>
14+
<testcase classname="isValidTagmode(value)" name="isValidTagmode(value) should return true for valid tagmode &quot;all&quot;" time="0"/>
15+
<testcase classname="isValidTagmode(value)" name="isValidTagmode(value) should return false for invalid tagmode" time="0"/>
16+
<testcase classname="hasValidFlickrAPIParams(tags, tagmode)" name="hasValidFlickrAPIParams(tags, tagmode) should return true for valid params" time="0"/>
17+
<testcase classname="hasValidFlickrAPIParams(tags, tagmode)" name="hasValidFlickrAPIParams(tags, tagmode) should return false for invalid tags" time="0"/>
18+
<testcase classname="hasValidFlickrAPIParams(tags, tagmode)" name="hasValidFlickrAPIParams(tags, tagmode) should return false for invalid tagmode" time="0"/>
19+
</testsuite>
20+
<testsuite name="getFlickrPhotos(tags, tagmode, callback)" tests="3" failures="0" errors="0" timestamp="2018-04-17T15:38:19.746Z" time="0.010000000000000002">
21+
<testcase classname="getFlickrPhotos(tags, tagmode, callback)" name="getFlickrPhotos(tags, tagmode, callback) should return photos" time="0.008"/>
22+
<testcase classname="getFlickrPhotos(tags, tagmode, callback)" name="getFlickrPhotos(tags, tagmode, callback) should error when api returns 500 http status code" time="0.001"/>
23+
<testcase classname="getFlickrPhotos(tags, tagmode, callback)" name="getFlickrPhotos(tags, tagmode, callback) should error with invalid jsonp data" time="0.001"/>
24+
</testsuite>
25+
<testsuite name="index route" tests="4" failures="0" errors="0" timestamp="2018-04-17T15:38:19.746Z" time="0.053000000000000005">
26+
<testcase classname="index route" name="index route should respond with a 200 with no query parameters" time="0.04"/>
27+
<testcase classname="index route" name="index route should respond with a 200 with valid query parameters" time="0.007"/>
28+
<testcase classname="index route" name="index route should respond with a 200 with invalid query parameters" time="0.003"/>
29+
<testcase classname="index route" name="index route should respond with a 500 error due to bad jsonp data" time="0.003"/>
30+
</testsuite>
31+
</testsuites>

0 commit comments

Comments
 (0)