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.

Testing code lens for wrapped test method

See original GitHub issue

Is your feature request related to a problem? Please describe.

As Deno has declined to extend their test API with hooks such as before/after, in some cases it is needed to extend this capability by wrapping the test method. As has been done in test_suite.

However, when doing so the extension fails to detect the new wrapped method as a test and doesn’t provide code lens to allow tests to be run individually.

image (line 10 has no Run test despite being recognized by Deno)

Describe the solution you’d like

Either a special syntax/annotation/type to mark a certain function as equivalent to Deno.test or tapping into Deno’s test detection and possibly using stack trace at the time of test registration to find indirectly registered tests.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
rivycommented, Jun 14, 2022

@kitsonk @dsherret , any thoughts about revisiting this?

There are lots of alternative testing paradigms and frameworks. Some sort of code lens API or wrapper recognition signal would be quite helpful to encourage the ecosystem. Currently, the code lens doesn’t recognize the BDD example tests included in std 0.143.0 (https://github.com/denoland/deno_std/blob/0.143.0/testing/bdd_examples/user_flat_test.ts).

1reaction
jespertheendcommented, Dec 17, 2021

I’m using tincan for writing tests, which uses a Jest-like api. So using a wrapper as shown above is not really an option in this case I think.

Read more comments on GitHub >

github_iconTop Results From Across the Web

View unit test results with CodeLens - Visual Studio Tutorial
You can see there's nothing between the test method and the declaration of the method. Now I'll go enable CodeLens. Easiest way to...
Read more >
Run/Debug code lenses don't appear · Issue #470 - GitHub
I'm having the same issue on two entirely separate machines; code lenses have stopped appearing and no tests are showing up in the...
Read more >
testing – James Pearson
Running one or more tests – regardless of where you run them from (Test Explorer, Command Palette, CodeLens, Keyboard Shortcut) – will start...
Read more >
Announcing CodeLens for C++ Unit Testing
To update the test status, you can Run the test directly from CodeLens above the desired test method. If your test fails, you...
Read more >
Programmatic Language Features - Visual Studio Code
Visual Studio Code language extensions contribute programming language features. ... function onChange() { let uri = document.uri; check(uri.
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