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

Vitest VSCode extension doesn't give information about test files written in another language #82

Closed
haikyuu opened this issue Sep 9, 2022 · 5 comments

Comments

@haikyuu
Copy link

haikyuu commented Sep 9, 2022

Describe the bug
I'm writing my test files using Imba. I'm using the Imba plugin for Vite, so Vite and vitest handle them correctly.
But I only see the file name in the tests pane.

To Reproduce
Steps to reproduce the behavior on this example project:

  1. Run tests in the extension
  2. You will only see the test files

Expected behavior
I would like to actually display the details from the test file

Screenshots
image

How to?

I'm not sure about how you analyze the test files. But it would work if the extension analyzes the transformed files instead.

@haikyuu haikyuu added the p3-minor-bug An edge case that only affects very specific usage (priority) label Sep 9, 2022
@ColinKrist
Copy link

ColinKrist commented Sep 9, 2022

I've opened up your sample repo - under .vscode's settings.json you need to configure vitest.include to include the file extensions of these files. The defaults are mentioned here: https://github.com/vitest-dev/vscode#config, and most notably don't include imba.

@haikyuu
Copy link
Author

haikyuu commented Sep 10, 2022

Let me explain, here is a test and its exact compiled version

Imba includes sourcemaps with the compiled code, so they should be picked up by the extension

image

@haikyuu
Copy link
Author

haikyuu commented Sep 10, 2022

I just found out that the extension uses babel to parse files and not Vite/Vitest

In order to support this feature, I believe we could hook into Vitest which already provides this information (example here that gets sourcemaps in the context of a reporter) instead of parsing files using babel.

@jmagaram
Copy link

Probably related to my similar issue of tests written in ReScript.

#127

@sheremet-va
Copy link
Member

sheremet-va commented Mar 15, 2024

This is now supported in pre-release 0.5.0 and higher. Note that the extension now requires Vitest 1.4.0 or higher.

I am adding a "needs test" flag to make sure we don't introduce a regression later down the line.

@sheremet-va sheremet-va added needs test and removed p3-minor-bug An edge case that only affects very specific usage (priority) labels Mar 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants