Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-sonar

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-sonar - npm Package Compare versions

Comparing version 0.1.3 to 0.2.0

11

__test__/reporter.spec.js

@@ -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 @@

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc