Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure test to run on non Deno.test()? #606

Closed
clemens-tolboom opened this issue Jan 11, 2022 · 6 comments
Closed

How to configure test to run on non Deno.test()? #606

clemens-tolboom opened this issue Jan 11, 2022 · 6 comments
Labels
documentation Improvements or additions to documentation testing Running test using LSP

Comments

@clemens-tolboom
Copy link

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

I'd like to run tests like done in ie https://github.com/denoland/deno_std/blob/main/fs/walk_test.ts where test_walk() takes care of setup and teardown.

I'm not sure whether this is either a simple tasks.json thing or problemMatcher: $deno-test like we have for in editor Run Test | Debug

deno-test-single-test

Describe the solution you'd like

As test_walk() is a user defined function name as match could be test_* or the responsibility of the user to enter valid values/patterns.

@KyleJune
Copy link

Describe the solution you'd like

As test_walk() is a user defined function name as match could be test_* or the responsibility of the user to enter valid values/patterns.

I think it would be better if that could work with other function names too rather than just those with the "test_" prefix, for example if you are using a wrapper around Deno.test for writing tests in describe/it blocks.

@clemens-tolboom
Copy link
Author

writing tests in describe/it blocks

What does that mean :-)

I just learned deno test --filter "value" matches the

Deno.test({
    name: "value"

How does that work? I cannot find this code :-/

@KyleJune
Copy link

This is an example I wrote. There are others out there. Other common JavaScript test runners use describe functions for grouping tests together and giving them shared setup/teardown with before after hooks. Then it functions for the actual individual test cases.

https://deno.land/x/[email protected]#describeit

@clemens-tolboom
Copy link
Author

@KyleJune thanks for the pointer to describe/it example. I know see your 'wrapped' issue. Have you checked with test_walk too.

Do you know a pointer to my other question in #606 (comment) ?

@bartlomieju bartlomieju added documentation Improvements or additions to documentation testing Running test using LSP labels Jul 11, 2023
@nayeemrmn
Copy link
Collaborator

Duplicate of #572.

@bartlomieju
Copy link
Member

I'm gonna close it in favor of #572

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation testing Running test using LSP
Projects
None yet
Development

No branches or pull requests

4 participants