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

Extension is unable run test with same in same file scope with describe #2

Closed
eratio08 opened this issue Mar 25, 2022 · 3 comments
Closed

Comments

@eratio08
Copy link

eratio08 commented Mar 25, 2022

The extension will fail with

Test result not found. 

Can you run vitest successfully on this file? Does it need custom option to run?

Does this file contain test case with the same name? 

if the following setup is present:

describe('example', () => {
    describe('scope 1', () => {
        test('potential same name', () => {
         ...
        });
    })
    describe('scope 2', () => {
        test('potential same name', () => {
         ...
        });
    })
})

It this a deliberate choice?

@eratio08 eratio08 reopened this Mar 25, 2022
@zxch3n
Copy link
Member

zxch3n commented Mar 25, 2022

Yeah, because the current vitest output files don't have enough information to differentiate the test cases with the same names. Maybe this can be fixed in the future when this plugin switches to use vitest server. I'll make a patch to let the plugin try to resolve the tests - which will probably go wrong when testing the async functions - while raising warnings.

@zxch3n
Copy link
Member

zxch3n commented Mar 25, 2022

Oh, I found that Jest test results include the information I need to deduce the concrete test cases. That format makes more sense. Since vitest is obeying jest interfaces to maximize compatibility, I'll make a PR to vitest.

@eratio08 eratio08 changed the title Extension is unable run handle test with same in same file scope with describe Extension is unable run test with same in same file scope with describe Mar 25, 2022
@zxch3n
Copy link
Member

zxch3n commented Mar 29, 2022

Fixed in v0.1.11. You also need to upgrade vitest to v0.8.0 because the JSON output format is changed.

Related PR vitest-dev/vitest#1034

@zxch3n zxch3n closed this as completed Mar 29, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants