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.

feat: Allow passing `stats` object to `pass` and `fail` functions

See original GitHub issue

It would be useful to allow passing stats object to pass and fail functions.

Use case. Some runners (for instance, jest-runner-tsd) are counting passing / failing tests per file. If I get it right, at the moment create-jest-runner assumes that the whole file passed or failed. Hence, jest-runner-tsd is implementing custom pass, fail and toTestResult functions. Looks like this is unnecessary boiler plate code.

Alternatively it would be possible to expose toTestResult from create-jest-runner. Not sure about this. I think it is better to extend pass, fail allowing to pass stats (with defaults as they are set now):

interface Stats {
  failures: number;
  passes: number;
  pending: number;
  todo: number;
}

Glad to work on this. Just wanted to agree on the directions first.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lokshunhungcommented, Nov 12, 2021

@mrazauskas I found it, here you go (The basic functionality of spell checking sort of works). I think all the runners that I listed in my last message are not written in TypeScript.

Just “sort of constants”, not constants in the strict sense.

I guess that’s one way to put it. You treat each one as a template as a possible outcome of the test result.

1reaction
SimenBcommented, Oct 15, 2021

Yeah, seems sensible 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

working with functions in Python - ZetCode
We define three functions. We place them in a tuple and pass them to a function. We place three function objects in a...
Read more >
tsflex.features API documentation
This component allows to create multiple feature descriptors for all the function - series_name(s) - window - stride combinations. As shown in the...
Read more >
An Introduction to R - The Comprehensive R Archive Network
An Introduction to R. This is an introduction to R (“GNU S”), a language and environment for statistical computing and graphics. R is...
Read more >
facebook/jscodeshift: A JavaScript codemod toolkit. - GitHub
This passes the source of all passed through the transform module ... This object exposes the jscodeshift library and helper functions from the...
Read more >
Handle Missing Values in Objects - R
fail returns the object if it does not contain any missing values, and signals an error otherwise. na.omit returns the object with incomplete...
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