question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Simplify failure output

See original GitHub issue

With:

import test from 'ava';

test('returns true when happy', t => {
    throw new Error('unicorn');
});

It currently outputs:

❯ ava

  1 failed

  returns true when happy
  Error: unicorn
    Test.fn (test.js:5:8)

I think we should simplify it to:

❯ ava

  1 failed

  returns true when happy
  Error: unicorn
    test.js:5:8

So users can quickly see where the error came from. Test.fn doesn’t have any value to the user.

This also applies to the verbose reporter ($ ava --verbose).

We could also use https://github.com/sindresorhus/ansi-escapes#itermsetcwdpath to make the path clickable on iTerm.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
sindresorhuscommented, Feb 2, 2017

Only partly. The current output looks like:

❯ ava

  1 failed

  foo
  test.js:24

   23:
   24:   throw new Error('unicorn');
   25: });

  Error: unicorn

  Test.fn (test.js:24:8)

As you can see, the test file and line are shown twice. I think we could simplify it to not show the stack trace if it’s only the test function. @avajs/core Thoughts?

1reaction
sotojuancommented, Oct 12, 2016

I can take care of this as I’ve worked with the reporters before.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simplify test failure output · Issue #518 · wix/Detox - GitHub
I would be interested in contributing to Detox to simplify the test failure output, if it's interesting and nobody is already working on...
Read more >
Simplifying and Isolating Failure-Inducing Input - CS@Purdue
Abstract—Given some test case, a program fails. Which circumstances of the test case are responsible for the particular failure? The Delta Debugging.
Read more >
Simplifying Failure-Inducing Input
Our goal is now to simplify the failing test case C—that is, to min-. imize it. ... the output is still wrong; if...
Read more >
Simplifying and Isolating Failure-Inducing Input
The function rtest : R → {✓,✘,?} determines for a program run r∈R whether some specific failure occurs (✓) or not (✘) or...
Read more >
Print Quality Guide | Simplify3D Software
We have compiled an extensive list of the most common 3D printing issues along with the software settings that you can use to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found