jest-sonar
Advanced tools
Comparing version 0.1.3 to 0.2.0
@@ -39,2 +39,13 @@ const Reporter = require('../src/reporter'); | ||
] | ||
}, | ||
{ | ||
testFilePath: '/the/root/my-skipped-test.spec.js', | ||
testResults: [ | ||
{ | ||
fullName: 'Skipped', | ||
duration: 10, | ||
failureMessages: [], | ||
status: 'pending' | ||
} | ||
] | ||
} | ||
@@ -41,0 +52,0 @@ ] |
@@ -5,2 +5,16 @@ # Changelog | ||
## [0.2.0](https://github.com/sh33dafi/jest-sonar/compare/v0.1.1...v0.2.0) (2019-08-01) | ||
### Bug Fixes | ||
* **report:** Rewrote how to create a dir recusivly so we are compatible with node < 10 ([e662b9c](https://github.com/sh33dafi/jest-sonar/commit/e662b9c)) | ||
### Features | ||
* **reporter:** Added output for skipped tests ([60d1b40](https://github.com/sh33dafi/jest-sonar/commit/60d1b40)) | ||
### [0.1.3](https://github.com/sh33dafi/jest-sonar/compare/v0.1.1...v0.1.3) (2019-07-30) | ||
@@ -7,0 +21,0 @@ |
{ | ||
"name": "jest-sonar", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"description": "A sonar reporter for jest", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -15,3 +15,4 @@ const path = require('path'); | ||
duration: testCase.duration, | ||
failures: testCase.failureMessages | ||
failures: testCase.failureMessages, | ||
status: testCase.status | ||
}; | ||
@@ -27,2 +28,14 @@ }) | ||
function failedTest(testCase) { | ||
return testCase.failures && testCase.failures.length > 0; | ||
} | ||
function skippedTest(testCase) { | ||
return testCase.status === 'pending'; | ||
} | ||
function successFullTest(testCase) { | ||
return !failedTest(testCase) && !skippedTest(testCase); | ||
} | ||
results.forEach(testFile => { | ||
@@ -37,7 +50,15 @@ const buildTestCase = testCase => | ||
testFile.testCases.forEach(testCase => { | ||
if (!testCase.failures || testCase.failures.length === 0) { | ||
if (successFullTest(testCase)) { | ||
render.push(`${buildTestCase(testCase)} />`); | ||
} else { | ||
render.push(`${buildTestCase(testCase)}>`); | ||
render.push(testCase.failures.map(buildFailure)); | ||
if (failedTest(testCase)) { | ||
render.push(testCase.failures.map(buildFailure)); | ||
} | ||
if (skippedTest(testCase)) { | ||
render.push(`<skipped message="${testCase.name}"/>`); | ||
} | ||
render.push(`</testCase>`); | ||
@@ -44,0 +65,0 @@ } |
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
213151
172