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

Multiple tests run when I only choose one to be tested #304

Closed
diego-pan opened this issue Mar 23, 2023 · 3 comments
Closed

Multiple tests run when I only choose one to be tested #304

diego-pan opened this issue Mar 23, 2023 · 3 comments

Comments

@diego-pan
Copy link

I'm experiencing a situation where when I choose to Run, or Debug a single test, it actually runs two tests.

For example, when I choose Debug here:

image

It will run the test I chose, and the one below it. If seems to pick up this second test based on the test description string -- since they both begin with similar text: "creates a user account".

describe('Test a module', () => {
    test('creates a user account', () => {
        // ..... test code here
    });

    test('creates a user account without an address', () => {
        // ..... test code here
    });
});

Is this by design? Is there a configuration option that I could tweak so only tests I choose are run?

@hnrchrdl
Copy link

I think what we would need here is to make the -t param more precise.
the runner adds -t 'creates a user account', which in your example matches both test cases. maybe better would be -t '^creates a user account$'.

@firsttris
Copy link
Owner

i think this pull-request #282 contains what you need?

@hnrchrdl
Copy link

i think this pull-request #282 contains what you need?

exactly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants