Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing 'diag' Object in jest-tap-reporter Parsed Results #80

Open
shanil-sasikumar opened this issue Oct 25, 2023 · 0 comments
Open

Missing 'diag' Object in jest-tap-reporter Parsed Results #80

shanil-sasikumar opened this issue Oct 25, 2023 · 0 comments

Comments

@shanil-sasikumar
Copy link

shanil-sasikumar commented Oct 25, 2023

I've been using the jest-tap-reporter to generate TAP reports for my Jest tests. When parsing the TAP results from Jest tests, I noticed that the diag object is missing, which is important for diagnosing test failures. In contrast, when using the tap-parser library to parse TAP results from Node Tap, the diag object is present, providing valuable information about the failure.

Steps to Reproduce:

  1. Run Jest tests with jest-tap-reporter
  2. Parse the TAP results and examine the parsed results.

Expected Behavior:
The parsed TAP results from Jest tests using jest-tap-reporter should include the diag object, just like the results from Node Tap tests.

Actual Behavior:
The diag object is missing from the parsed TAP results generated by jest-tap-reporter.

Additional Information:
Please find the example parsed TAP results for a failed test case below:

Jest TAP Parsed Result:

{
  ok: false,
  name: '[FII-OPSU-QA-SEO-0001.98]-Opsfolio Suite page URL: <a href="http://localhost:4321/policies/information-technology-quality-infrastructure/common-user-login-access-policy/"></a> navigation and title check',
  id: 486,
  buffered: false,
  tapError: null,
  skip: false,
  todo: false,
  previous: null,
  plan: null,
  diag: null, // Missing 'diag' object
  time: null,
  fullname: '[FII-OPSU-QA-SEO-0001.98]-Opsfolio Suite page URL: <a href="http://localhost:4321/policies/information-technology-quality-infrastructure/common-user-login-access-policy/"></a> navigation and title check',
  closingTestPoint: false
}

Node Tap Parsed Result:

{
  ok: false,
  name: 'Error occurred: Error: page.$eval: Error: failed to find element matching selector ".left-footer"',
  id: 9,
  buffered: false,
  tapError: null,
  skip: false,
  todo: false,
  previous: null,
  plan: null,
  diag: {
    operator: 'fail',
    at: '<anonymous> (/tests/opsfolio.test.ts:158:9)',
    stack: 'Error: Error occurred: Error: page.$eval: Error: failed to find element matching selector ".left-footer"\n' +
      '    at Test.assert [as _assert] (/node_modules/tape/lib/test.js:479:48)\n' +
      '    at Test.fail (/node_modules/tape/lib/test.js:573:7)\n' +
      '    at /tests/opsfolio.test.ts:158:9\n' +
      '    at step (/tests/opsfolio.test.ts:33:23)\n' +
      '    at Object.throw (/tests/opsfolio.test.ts:14:53)\n' +
      '    at rejected (/tests/opsfolio.test.ts:6:65)'
  },
  time: null,
  fullname: 'Error occurred: Error: page.$eval: Error: failed to find element matching selector ".left-footer"',
  closingTestPoint: false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant