-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
add type exports to the JSON reporter #5068
Labels
enhancement
New feature or request
p2-nice-to-have
Not breaking anything but nice to have (priority)
Comments
Exposing the type sounds like a nice addition to me. For the time being, I think you can manually copy-paste types from here since these types are self-contained: vitest/packages/vitest/src/node/reporters/json.ts Lines 13 to 63 in 315325e
Example https://stackblitz.com/edit/vitest-dev-vitest-6eyewm?file=example.ts |
hi-ogawa
added
enhancement
New feature or request
p2-nice-to-have
Not breaking anything but nice to have (priority)
labels
Jan 30, 2024
6 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
enhancement
New feature or request
p2-nice-to-have
Not breaking anything but nice to have (priority)
Clear and concise description of the problem
I want to summarize json vitest output in my CI using typescript. I want to import types for IDE functionality and the ability to type-check my summary script.
Suggested solution
Export the existing types so that they could be imported from "vitest/reporters".
Alternative
Factor a helper out of logTasks method of JsonReporter so that we can use indexed types for the JSON contents
Additional context
This change would make it possible to type-check for any changes to the json format affecting an automated system reading that json output.
Keep in mind that there's no "vitest/reporters/json" because of the build step.
Validations
The text was updated successfully, but these errors were encountered: