Less verbose test function
See original GitHub issueCurrently, the test
function has the following usage:
// #1
test({
name: "example",
fn() {
// test code
}
});
// #2
test(function example() {
// test code
});
I like #2
, but I think #1
is a bit verbose.
How about this instead?
test("example", () => {
// test code
});
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:16 (14 by maintainers)
Top Results From Across the Web
How can i make the output less verbose - pytest - Stack Overflow
Running pytest -vv should make your output more verbose. If you want your output to be less verbose, try pytest -q or pytest...
Read more >Failed test output is less verbose with -v than not using -v #5192
I might need to revise my solution above. It'll work for an assertion such as assert len(s) == 1 , where the default...
Read more >Golang: Error Handling In One Line of Code - Medium
I like to share my experience on error handling and introduce some helper functions which help me to write less verbose code.
Read more >Test for Verbose in Powershell - briantist.com
Determine whether -Verbose or $VerbosePreference is in effect in the current context in Powershell, whether inherited or set explicitly.
Read more >Managing pytest's output — pytest documentation
The -v flag controls the verbosity of pytest output in various aspects: test session progress, assertion details when tests fail, fixtures details with...
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
@sholladay Hm - looks quite minimal and similar to ours. I’m not opposed to that API.
@piscisaureus thoughts? https://github.com/avajs/ava/blob/master/docs/01-writing-tests.md
Sorry, I meant the API definition (or a small subset of it), not necessarily the implementation. Would be awesome if AVA’s implementation could be ported, but I agree that sounds hard. Among other things, AVA relies on Node’s
child_process
. It might be possible to replace that with Web Workers, but there could be other issues.If, however, Deno were to adopt the API of a popular framework like AVA, it would make it easier to port the implementation in the future as better tooling comes along to do that, and as libraries begin to use more runtime agnostic patterns. At the very least it would make Deno more familiar and approachable.
The similarities don’t have to go super deep, IMO, as long as test definitions and assertions are the same.