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

Add sourcemap support #70

Open
kayahr opened this issue Jul 1, 2023 · 0 comments
Open

Add sourcemap support #70

kayahr opened this issue Jul 1, 2023 · 0 comments

Comments

@kayahr
Copy link

kayahr commented Jul 1, 2023

I'm not a friend of ts-jest so I always use a two-step process: Compile TypeScript with standard tsc from src to lib and then call Jest on the JavaScript files in lib. Jest automatically uses the sourcemaps generated by tsc to show correct TypeScript stack traces and also the Coverage report correctly shows the TypeScript sources. But jest-sonar unfortunately reports JavaScript files from the lib directory in the report and not TypeScript files from the src directory. And because of this Sonar for some reason ignores all files in the report, I guess because it expects TypeScript files, not JavaScript.

When I manually replace all paths like lib/test/Project.test.js in the report with for example src/test/Project.test.ts and let Sonar use this modified file then unit tests are correctly reported in Sonar.

So would it be possible to add sourcemap support in jest-sonar so it automatically references the TypeScript source files in the report instead of the JavaScript files? Like Jest itself is already doing it.

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 a pull request may close this issue.

1 participant