New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@empiricalrun/reporter

Package Overview
Dependencies
Maintainers
0
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@empiricalrun/reporter - npm Package Compare versions

Comparing version 0.14.1 to 0.14.2

6

CHANGELOG.md
# @empiricalrun/reporter
## 0.14.2
### Patch Changes
- cc33982: feat: show flaky tests in reporter in mobile platforms
## 0.14.1

@@ -4,0 +10,0 @@

2

dist/sources/appium/types.d.ts

@@ -7,3 +7,3 @@ export interface AppiumTest {

flake: boolean;
suite: string;
testCaseId: string;
}

@@ -10,0 +10,0 @@ export interface AppiumSummary {

@@ -25,3 +25,3 @@ "use strict";

flake: false,
suite: result["ns2:test-suite"].name,
testCaseId: testCase.testCaseId,
};

@@ -43,2 +43,38 @@ });

}
function modifyTestsToHandleFlakyCases(testCases) {
let modifiedTests = [];
testCases.forEach((testCase) => {
if (isTestFlaky(testCases, testCase.testCaseId, testCase.status)) {
const passedTest = getPassedTest(testCases, testCase.testCaseId);
if (passedTest) {
passedTest.flake = true;
const isAlreadyProcessed = modifiedTests.some((test) => test.testCaseId === passedTest.testCaseId);
if (!isAlreadyProcessed) {
modifiedTests.push(passedTest);
}
}
}
else {
const isAlreadyProcessed = modifiedTests.some((test) => test.testCaseId === testCase.testCaseId);
if (!isAlreadyProcessed) {
modifiedTests.push(testCase);
}
}
});
return modifiedTests;
}
function isTestFlaky(testCases, testId, status) {
// A test is flaky if it has both passed and failed/broken status across retries
if (status === "passed") {
return testCases.some((testCase) => testCase.testCaseId === testId &&
(testCase.status === "failed" || testCase.status === "broken"));
}
else if (status === "failed" || status === "broken") {
return testCases.some((testCase) => testCase.testCaseId === testId && testCase.status === "passed");
}
return false;
}
function getPassedTest(testCases, testId) {
return testCases.find((testCase) => testCase.testCaseId == testId && testCase.status === "passed");
}
function parsedSummary(testCases) {

@@ -94,4 +130,5 @@ const hasTestCases = testCases.length > 0;

}
testCases = modifyTestsToHandleFlakyCases(testCases);
return parsedSummary(testCases);
}
exports.generateJsonFile = generateJsonFile;
{
"name": "@empiricalrun/reporter",
"version": "0.14.1",
"version": "0.14.2",
"publishConfig": {

@@ -5,0 +5,0 @@ "registry": "https://registry.npmjs.org/",

Sorry, the diff of this file is not supported yet

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