Skip to content

Conversation

@robertbrignull
Copy link
Contributor

This is an alternative / builds upon #75

The extra bits are:

  • Run ava in verbose mode. This disables the fancy spinner and means that printing doesn't mess it up. I think ava is also doing some kind of output suppression but I haven't been able to fully verify, but anyway this turns it off.
  • Instead of only suppressing some output, forward all of it to a string in memory, and then only print it all if the test fails. I think this gives a nice user experience by being very minimal when everything passes but giving you all the information when something fails.
  • Uses typedTest.afterEach.always instead of typedTest.afterEach because the latter only runs on passing tests.

Merge / deployment checklist

  • Run test builds as necessary. Can be on this repository or elsewhere as needed in order to test the change - please include links to tests in other repos!
    • CodeQL using init/analyze actions
    • 3rd party tool using upload action
  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.

Copy link
Contributor

@sampart sampart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my goodness, this is SUCH a big step on from what I did. Love it! Just one comment.

@robertbrignull robertbrignull merged commit 5bb9e6e into main Jun 24, 2020
@robertbrignull robertbrignull deleted the only-output-on-failure branch June 24, 2020 13:03
};
}

export function silenceDebugOutput(test: TestInterface<any>) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In hindsight, should perhaps rename this to something else. I'll open a new PR for that.

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

Successfully merging this pull request may close these issues.

3 participants