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.

Less verbose test function

See original GitHub issue

Currently, 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:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:16 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
rycommented, Feb 12, 2019

@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

1reaction
sholladaycommented, Feb 12, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

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