Skip to content

Commit be0790b

Browse files
committed
feat: Allow cutting the same initial part of the path from tested HTML files
1 parent 1ac6396 commit be0790b

File tree

11 files changed

+1125
-17
lines changed

11 files changed

+1125
-17
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules
33
npm-debug.log
44
tests/actual
55
tests/extra
6+
tests/extra2

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ Gruntfile.js
88
node_modules
99
npm-debug.log
1010
tests/actual
11+
tests/extra
12+
tests/extra2

Gruntfile.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ module.exports = function (grunt) {
5656
src: 'tests/expected/report.json',
5757
dest: 'tests/extra/'
5858
},
59+
showCommonPathOnly: {
60+
options: {
61+
showCommonPathOnly: false
62+
},
63+
src: 'tests/expected/report.json',
64+
dest: 'tests/extra2/'
65+
},
5966
includeUnreported: {
6067
options: {
6168
includeUnreported: true
@@ -71,7 +78,7 @@ module.exports = function (grunt) {
7178
},
7279

7380
clean: {
74-
tests: ['tests/actual/*', 'tests/extra']
81+
tests: ['tests/actual/*', 'tests/extra', 'tests/extra2']
7582
}
7683
})
7784

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Default options support the most usual usage scenario:
4141
targetExtension: '.html',
4242
ignoreMissing: false,
4343
showFileNameOnly: false,
44+
showCommonPathOnly: true,
4445
force: false
4546
},
4647
all: {
@@ -198,6 +199,7 @@ your code using Grunt.
198199

199200
## Release History
200201

202+
* 2018-05-14 v3.1.0 Allow cutting the same initial part of the path from tested HTML files for displaying purposes
201203
* 2018-04-27 v3.0.0 Dropped support of Node.js 4
202204
* 2018-03-05 v2.2.0 Upgrade to the reporter v2.2.0, allow generating
203205
page titles from file names without directory

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232
},
3333
"dependencies": {
3434
"chalk": "^2.4.1",
35-
"grunt-html-html-reporter": "^3.0.0"
35+
"grunt-html-html-reporter": "^3.1.0"
3636
},
3737
"devDependencies": {
3838
"grunt": "^1.0.2",
3939
"grunt-contrib-clean": "^1.1.0",
4040
"grunt-contrib-nodeunit": "^1.0.0",
4141
"grunt-standard": "^3.1.0",
42-
"semantic-release": "^15.1.7",
43-
"travis-deploy-once": "^4.4.1"
42+
"semantic-release": "^15.4.1",
43+
"travis-deploy-once": "^5.0.0"
4444
},
4545
"peerDependencies": {
4646
"grunt": ">=0.4.5"

tasks/grunt-html-html-report-converter.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ module.exports = function (grunt) {
1717
ignoreMissing: false,
1818
includeUnreported: false,
1919
showFileNameOnly: false,
20+
showCommonPathOnly: true,
2021
force: false
2122
})
2223
const targetExtension = options.targetExtension
2324
const ignoreMissing = options.ignoreMissing
2425
const includeUnreported = options.includeUnreported
2526
const showFileNameOnly = options.showFileNameOnly
27+
const showCommonPathOnly = options.showCommonPathOnly
2628
const force = options.force
2729
const warn = force ? grunt.log.warn : grunt.fail.warn
2830
var files = this.files
@@ -116,7 +118,8 @@ module.exports = function (grunt) {
116118
try {
117119
const results = JSON.parse(fs.readFileSync(src, 'utf-8'))
118120
const generated = report(results, {
119-
showFileNameOnly: showFileNameOnly
121+
showFileNameOnly: showFileNameOnly,
122+
showCommonPathOnly: showCommonPathOnly
120123
})
121124
fs.writeFileSync(dest, generated, 'utf-8')
122125
++converted

0 commit comments

Comments
 (0)