feat: Allow passing `stats` object to `pass` and `fail` functions
See original GitHub issueIt 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:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
I guess that’s one way to put it. You treat each one as a template as a possible outcome of the test result.
Yeah, seems sensible 👍