From 013d6b7621f68586091c5e40b08576a766927487 Mon Sep 17 00:00:00 2001 From: Anudeep Date: Thu, 29 Feb 2024 23:40:53 +0530 Subject: [PATCH] Update testng.js (#55) * Update testng.js * Update package.json --- package.json | 2 +- src/parsers/testng.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 3f803df..f4520f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "test-results-parser", - "version": "0.1.7", + "version": "0.1.8", "description": "Parse test results from JUnit, TestNG, xUnit, cucumber and many more", "main": "src/index.js", "types": "./src/index.d.ts", diff --git a/src/parsers/testng.js b/src/parsers/testng.js index a9ebaef..ee4efb3 100644 --- a/src/parsers/testng.js +++ b/src/parsers/testng.js @@ -93,9 +93,9 @@ function getTestSuite(rawSuite) { const rawTest = rawTests[i]; const rawClasses = rawTest.class; for (let j = 0; j < rawClasses.length; j++) { - let testMethods = rawClasses[i]['test-method'].filter(raw => !raw['@_is-config']); + let testMethods = rawClasses[j]['test-method'].filter(raw => !raw['@_is-config']); testMethods.forEach(testMethod => { - testMethod["@_class"] = rawClasses[i]["@_name"]; // push className onto test-method + testMethod["@_class"] = rawClasses[j]["@_name"]; // push className onto test-method }); rawTestMethods.push(...testMethods); }