diff --git a/src/index.d.ts b/src/index.d.ts index 5164da7..85b16e3 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -2,7 +2,6 @@ import TestResult from "./models/TestResult"; declare interface ParseOptions { type: string; - ignore_error_count?: boolean; files: string[]; } diff --git a/src/parsers/junit.js b/src/parsers/junit.js index c103cb4..bcc71d2 100644 --- a/src/parsers/junit.js +++ b/src/parsers/junit.js @@ -44,13 +44,13 @@ function setErrorAndStackTrace(test_case, raw_case) { * @param {import('..').ParseOptions} options * @returns */ -function getTestSuite(rawSuite, options) { +function getTestSuite(rawSuite) { const suite = new TestSuite(); suite.name = rawSuite["@_name"]; suite.total = rawSuite["@_tests"]; suite.failed = rawSuite["@_failures"]; const errors = rawSuite["@_errors"]; - if (!options.ignore_error_count && errors) { + if (errors) { suite.errors = errors; } const skipped = rawSuite["@_skipped"]; @@ -164,7 +164,7 @@ function getTestResult(json, options) { result.total = rawResult["@_tests"]; result.failed = rawResult["@_failures"]; const errors = rawResult["@_errors"]; - if (!options.ignore_error_count && errors) { + if (errors) { result.errors = errors; } const skipped = rawResult["@_skipped"]; diff --git a/tests/parser.junit.spec.js b/tests/parser.junit.spec.js index e520548..c2a20ed 100644 --- a/tests/parser.junit.spec.js +++ b/tests/parser.junit.spec.js @@ -557,20 +557,6 @@ describe('Parser - JUnit', () => { assert.equal(result.status, 'FAIL'); }); - it('wdio - failures and ignore errors', () => { - const result = parse({ type: 'junit', ignore_error_count: true, files: [`${testDataPath}/wdio-failures-errors.xml`] }); - assert.equal(result.total, 4); - assert.equal(result.passed, 2); - assert.equal(result.failed, 2); - assert.equal(result.errors, 0); - assert.equal(result.duration, 91024); - assert.equal(result.status, 'FAIL'); - assert.equal(result.suites[0].cases[1].failure, `Error: element ("//button/span[text()='Continue']") still displayed after 20000ms`); - assert.match(result.suites[0].cases[1].stack_trace, /at file/); - assert.match(result.suites[0].cases[1].stack_trace, /async Element.wrapCommandFn/); - assert.match(result.suites[0].cases[1].stack_trace, /middlewares.js:18:32/); - }); - it('mocha - failures with stack trace', () => { const result = parse({ type: 'junit', ignore_error_count: true, files: [`${testDataPath}/mocha-failures-with-stack-trace.xml`] }); assert.equal(result.total, 51);