Skip to content

Commit

Permalink
revert: ignore errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ASaiAnudeep committed May 26, 2024
1 parent dd85b9e commit 713cbc7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
1 change: 0 additions & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import TestResult from "./models/TestResult";

declare interface ParseOptions {
type: string;
ignore_error_count?: boolean;
files: string[];
}

Expand Down
6 changes: 3 additions & 3 deletions src/parsers/junit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down Expand Up @@ -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"];
Expand Down
14 changes: 0 additions & 14 deletions tests/parser.junit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 713cbc7

Please sign in to comment.