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

fix(reporter): correct error source position in json report #1909

Merged
merged 14 commits into from
Aug 29, 2022

Conversation

azaleta
Copy link
Contributor

@azaleta azaleta commented Aug 24, 2022

fix for issue #1894

@antfu
Copy link
Member

antfu commented Aug 25, 2022

Do you mind adding a snapshot test for the generated JSON? Thanks.

@azaleta
Copy link
Contributor Author

azaleta commented Aug 25, 2022

@antfu
Hope it is ok.
Not familiar with sourcemap algorithm.
The test concept is set 2 sourcemap (with/without 2 line comments)
and the json report will have the line number difference

@azaleta azaleta closed this Aug 29, 2022
@azaleta azaleta reopened this Aug 29, 2022
import { clearSourcePos, files } from '../src/data'

const no_comment: TransformResult = {
code: 'const __vite_ssr_import_0__ = await __vite_ssr_import__("vitest");\n'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably too verbose. I am thinking to spawn a Vitest runner and read it's JSON output to snap

@antfu antfu changed the title fix: correct error source position in json report fix(reporter): correct error source position in json report Aug 29, 2022
@antfu antfu enabled auto-merge (squash) August 29, 2022 08:10
auto-merge was automatically disabled August 29, 2022 08:34

Head branch was pushed to by a user without write access

@azaleta
Copy link
Contributor Author

azaleta commented Aug 29, 2022

@antfu
node_modules/vitest/node_modules/@vitest/ui/node_modules/floating-vue/src/directives/v-tooltip.spec.ts
where is this come from ?

@antfu antfu merged commit 44b7fce into vitest-dev:main Aug 29, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants