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

Slight modification to stack output. #66

Open
Gazook89 opened this issue Apr 4, 2023 · 0 comments
Open

Slight modification to stack output. #66

Gazook89 opened this issue Apr 4, 2023 · 0 comments

Comments

@Gazook89
Copy link

Gazook89 commented Apr 4, 2023

Feature Request

Description:
I don't think this is currently possible, please correct me if I am wrong: I would like to have the output exclude the portion that shows me the relevant test in my test file...everything after the expected: / received:. Here is an example of my output right now:

Block: When using the Block syntax {{tags\ntext\n}} › Renders a div with a class, style and text

    Input:
    {{cat,color:red
    Sample text.
    }}

    expect(received).toBe(expected) // Object.is equality

    Expected: "<div class=\"block cat\" style=\"color:red;\"><p>Sample text.</p></div>"
    Received: "<div class=\"block cat\"  style=\"color:red;\"><p>Sample text.</p></div>"

      172 |             }}`;
      173 |             const rendered = Markdown.render(source).trimReturns();
    > 174 |             expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`<div class="block cat" style="color:red;"><p>Sample text.</p></div>`);
          |                                                                          ^
      175 |     });
      176 |
      177 |     it('Renders a div with an ID, class, style and text (different order)', function() {

      at Object.toBe (tests/markdown/mustache-syntax.test.js:174:64)

Everything from the "line 172" on down is not very helpful, at least in my case, but takes consider space in the full output when doing many similar tests.

I have tried the showMatcherMessage and showStack options, but no combination of the two removes just this portion without also affecting the display of the Expected/Received, which I still need.

Possible solution:
Not sure how it figures into this library, but I can disable the stack as described above with just using the Jest CLI option --noStackTrace. I'm not sure why showStack: false doesn't have the exact same result? I'm not sure if this a bug, or a feature request.

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