Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure message is nested text now: allows to see newlines in Jenkins… #17

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules
yarn.lock
junit.xml
package-lock.json
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"dependencies": {
"mkdirp": "^0.5.1",
"strip-ansi": "^4.0.0",
"xml": "^1.0.1"
},
"devDependencies": {
Expand Down
7 changes: 2 additions & 5 deletions utils/buildJsonResults.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const constants = require('../constants/index');
const stripAnsi = require('strip-ansi');

const replaceVars = function (str, classname, title) {
return str
Expand Down Expand Up @@ -64,11 +65,7 @@ module.exports = function (report, appDirectory, options) {
if (tc.status === 'failed') {
tc.failureMessages.forEach((failure) => {
testCase.testcase.push({
'failure': [{
_attr: {
message: failure || ''
}
}]
'failure': stripAnsi(failure || '')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "_attr" attribute needs to be there otherwise the format of the junit.xml won't be to spec

});
})
}
Expand Down
Loading