Skip to content

Commit daba7bf

Browse files
committed
added skipped tests to total at suite level
1 parent 21b597d commit daba7bf

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "test-results-parser",
3-
"version": "0.0.6",
3+
"version": "0.0.7",
44
"description": "Parse test results from JUnit, TestNG, xUnit and many more",
55
"main": "src/index.js",
66
"types": "./src/index.d.ts",

src/parsers/testng.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function getTestSuiteFromTest(rawTest) {
2929
suite.failed = rawTestMethods.filter(test => test['@_status'] === 'FAIL').length;
3030
suite.skipped = rawTestMethods.filter(test => test['@_status'] === 'SKIP').length;
3131
if (suite.skipped) {
32-
suite.total = suite.total - suite.skipped;
32+
// suite.total = suite.total - suite.skipped;
3333
}
3434
suite.status = suite.total === suite.passed ? 'PASS' : 'FAIL';
3535
for (let i = 0; i < rawTestMethods.length; i++) {
@@ -56,7 +56,7 @@ function getTestSuite(rawSuite) {
5656
suite.failed = rawTestMethods.filter(test => test['@_status'] === 'FAIL').length;
5757
suite.skipped = rawTestMethods.filter(test => test['@_status'] === 'SKIP').length;
5858
if (suite.skipped) {
59-
suite.total = suite.total - suite.skipped;
59+
// suite.total = suite.total - suite.skipped;
6060
}
6161
suite.status = suite.total === suite.passed ? 'PASS' : 'FAIL';
6262
for (let i = 0; i < rawTestMethods.length; i++) {

tests/parser.testng.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ describe('Parser - TestNG', () => {
190190
{
191191
"id": "",
192192
"name": "mobile-ios",
193-
"total": 4,
193+
"total": 5,
194194
"passed": 2,
195195
"failed": 2,
196196
"errors": 0,
@@ -517,7 +517,7 @@ describe('Parser - TestNG', () => {
517517
});
518518
});
519519

520-
it('multiple suites with multiple tests', () => {
520+
it('multiple suites with retries', () => {
521521
const result = parse({ type: 'testng', files: ['tests/data/testng/multiple-suites-retries.xml'] });
522522
assert.deepEqual(result, {
523523
"id": "",
@@ -534,7 +534,7 @@ describe('Parser - TestNG', () => {
534534
{
535535
"id": "",
536536
"name": "desktop-chrome",
537-
"total": 3,
537+
"total": 4,
538538
"passed": 2,
539539
"failed": 1,
540540
"errors": 0,
@@ -603,7 +603,7 @@ describe('Parser - TestNG', () => {
603603
{
604604
"id": "",
605605
"name": "mobile-andoid",
606-
"total": 3,
606+
"total": 4,
607607
"passed": 2,
608608
"failed": 1,
609609
"errors": 0,

0 commit comments

Comments
 (0)