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

[Feature] output without stack trace. #136

Closed
nesless opened this issue Jul 11, 2020 · 3 comments
Closed

[Feature] output without stack trace. #136

nesless opened this issue Jul 11, 2020 · 3 comments

Comments

@nesless
Copy link

nesless commented Jul 11, 2020

I don't think there is any option not to include stack trace in output file.

F.E. doesn't include following stack trace:

at Object.<anonymous> (/Users/someone/src/tests/index.test.js:39:23)
at processTicksAndRejections (internal/process/task_queues.js:93:5)

@palmerj3
Copy link
Collaborator

I'm not sure I understand what you're reporting here.

Please describe the issue and then provide a repository that reproduces the problem and I'll have a look.

@sginter
Copy link
Contributor

sginter commented Mar 15, 2021

I think I have the same problem :-)

So, what I need is:

<testcase classname="additional test" name="case 1" time="0.004">
   <failure>Error: expect(received).toEqual(expected) // deep equality

Expected: 2
Received: 6
</failure>

What I get is:

<testcase classname="additional test" name="case 1" time="0.004">
   <failure>Error: expect(received).toEqual(expected) // deep equality

Expected: 2
Received: 6
at [stack trace element]
at [stack trace element]
...
</failure>

It comes from

tc.failureMessages.forEach((failure) => {

(adding tc.failureMessages instead of tc.failureDetails[].message without the tc.failureDetails[].stack appended)

Sorry, I don't know the code base, but it seems to come from jest (actually, is it jest-jasmine reporter.js?) and it seems that it includes the stack trace despite the --noStackTrace param passed to jest. I assume it means its reporter's job to include the stack or not :-)

I would gladly come back with a pull request, but please advise how to approach it?
Additional option similar to includeConsoleLog?
includeStackTraces defaulting to true?

@palmerj3
Copy link
Collaborator

That's a good point. I'm not sure how that feature of jest works.. but if jest-junit gets the output for the failure message we're going to show it.

I suspect this is an issue or a misunderstanding with how Jest handles that CLI flag.

I'd be happy if you investigate it further. I suspect the issue is on the jest side not on the jest-junit side.
But I'm always happy to accept PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants