jest-sonar
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -31,2 +31,22 @@ const Reporter = require('../src/reporter'); | ||
{ | ||
testFilePath: '/the/root/my-test/my-test.spec.js', | ||
testResults: [ | ||
{ | ||
fullName: `Some crazy title with ${String.fromCharCode( | ||
27 | ||
)}[31;1m red color ${String.fromCharCode( | ||
27 | ||
)}[0m and 🔥`, | ||
duration: 30, | ||
failureMessages: [] | ||
}, | ||
{ | ||
fullName: | ||
'When this is failing the sonar report should contain the failure', | ||
duration: 10, | ||
failureMessages: ['A failure'] | ||
} | ||
] | ||
}, | ||
{ | ||
testFilePath: '/the/root/my-second-test.spec.js', | ||
@@ -33,0 +53,0 @@ testResults: [ |
@@ -5,2 +5,6 @@ # Changelog | ||
### [0.2.2](https://github.com/sh33dafi/jest-sonar/compare/v0.2.1...v0.2.2) (2019-08-26) | ||
### [0.2.1](https://github.com/sh33dafi/jest-sonar/compare/v0.2.0...v0.2.1) (2019-08-12) | ||
@@ -7,0 +11,0 @@ |
{ | ||
"name": "jest-sonar", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "A sonar reporter for jest", | ||
@@ -22,3 +22,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"eslint": "^6.0.1", | ||
"eslint": "^6.2.1", | ||
"eslint-config-prettier": "^6.0.0", | ||
@@ -30,3 +30,6 @@ "eslint-plugin-prettier": "^3.1.0", | ||
}, | ||
"dependencies": {} | ||
"dependencies": { | ||
"entities": "2.0.0", | ||
"strip-ansi": "5.2.0" | ||
} | ||
} |
@@ -1,15 +0,7 @@ | ||
const map = { | ||
'>': '>', | ||
'<': '<', | ||
"'": ''', | ||
'"': '"', | ||
'&': '&' | ||
}; | ||
const entities = require('entities'); | ||
const stripAnsi = require('strip-ansi'); | ||
module.exports = function(value) { | ||
if (value === null || value === undefined) return; | ||
return value.replace(new RegExp('([&"<>\'])', 'g'), (str, item) => { | ||
return map[item]; | ||
}); | ||
module.exports = value => { | ||
if (typeof value !== 'string') return ''; | ||
return entities.encodeXML(stripAnsi(value)); | ||
}; |
const path = require('path'); | ||
const xml = require('xml'); | ||
const escape = require('./escape'); | ||
@@ -43,3 +42,5 @@ | ||
const buildTestCase = testCase => | ||
`<testCase name="${escape(testCase.name)}" duration="${escape(testCase.duration)}"`; | ||
`<testCase name="${escape(testCase.name)}" duration="${escape( | ||
testCase.duration | ||
)}"`; | ||
const buildFailure = failure => | ||
@@ -46,0 +47,0 @@ `<failure message="Error"><![CDATA[${failure}]]></failure>`; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
216614
201
2
+ Addedentities@2.0.0
+ Addedstrip-ansi@5.2.0
+ Addedansi-regex@4.1.1(transitive)
+ Addedentities@2.0.0(transitive)
+ Addedstrip-ansi@5.2.0(transitive)