Skip to content

Commit

Permalink
Update build matrix (#194)
Browse files Browse the repository at this point in the history
* Fix lint
* Update npm publish node version
  • Loading branch information
clayreimann authored Jul 12, 2023
1 parent 3cecb0b commit dfa236c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
module.exports = {
"env": {
"browser": true,
"node": true
"node": true,
"es2020": true,
},
"extends": "eslint:recommended",
"rules": {
Expand Down
19 changes: 2 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,8 @@ jobs:

strategy:
matrix:
include:
- mocha-version: 2
node-version: 10.x
- mocha-version: 3
node-version: 10.x
- mocha-version: 4
node-version: 10.x
- mocha-version: 5
node-version: 10.x
- mocha-version: 6
node-version: 10.x
- mocha-version: 7
node-version: 12.x
- mocha-version: 8
node-version: 14.x
- mocha-version: 9
node-version: 14.x
mocha-version: [6, 7, 8, 9]
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
node-version: 20
- run: npm ci
- run: npm test

Expand All @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ MochaJUnitReporter.prototype.removeInvalidCharacters = function(input){
*/
MochaJUnitReporter.prototype.flush = function(testsuites){
this._xml = this.getXml(testsuites);

var reportFilename = this.formatReportFilename(this._xml, testsuites);

this.writeXmlToDisk(this._xml, reportFilename);
Expand Down Expand Up @@ -432,10 +432,10 @@ MochaJUnitReporter.prototype.formatReportFilename = function(xml, testsuites) {
reportFilename = reportFilename.replace('[rootSuiteTitle]', this._options.rootSuiteTitle);
}
if (reportFilename.indexOf('[suiteFilename]') !== -1) {
reportFilename = reportFilename.replace('[suiteFilename]', testsuites[0]?.testsuite[0]?._attr.file ?? 'suiteFilename');
reportFilename = reportFilename.replace('[suiteFilename]', testsuites[0]?.testsuite[0]?._attr?.file ?? 'suiteFilename');
}
if (reportFilename.indexOf('[suiteName]') !== -1) {
reportFilename = reportFilename.replace('[suiteName]', testsuites[1]?.testsuite[0]?._attr.name ?? 'suiteName');
reportFilename = reportFilename.replace('[suiteName]', testsuites[1]?.testsuite[0]?._attr?.name ?? 'suiteName');
}

return reportFilename;
Expand Down
2 changes: 1 addition & 1 deletion test/mocha-junit-reporter-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ describe('mocha-junit-reporter', function() {
reporter.runner,
dir +
"results." +
(reporter._testsuites[0]?.testsuite[0]?._attr?.file ?? 'suiteFileName') +
(reporter._testsuites[0]?.testsuite[0]?._attr?.file ?? 'suiteFilename') +
".xml"
);
done();
Expand Down

0 comments on commit dfa236c

Please sign in to comment.