-
Notifications
You must be signed in to change notification settings - Fork 453
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
Sourcemaps do not work #114
Comments
can you create a minimal repo that reproduces the issue you're facing? |
closing due to lack of response. If this needs to be reopened, let me know |
@kulshekhar and what about providing an example with ts-jest GitHub repo? this is a good common practice. |
@tkrotoff there are tests in the repo that can help understand how to use |
Tests are not user friendly, examples are. See PR #118 |
@tkrotoff can't argue with that |
Also facing this problem. Not sure how to get sourcemaps to work. Sorry if this looks like a stackoverflow issue. Maybe we can improve the documentation. Would very much appreciate any hint!
"jest": {
"transform": {
".*": "<rootDir>/jest-preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"modulePaths": [
"./src"
],
"moduleFileExtensions": [
"js",
"jsx",
"json",
"ts",
"tsx"
],
"moduleDirectories": [
"node_modules",
"src"
]
}
const tsc = require('typescript');
const tsConfig = require('./tsconfig.json');
module.exports = {
process(src, path) {
if (path.endsWith('.ts') || path.endsWith('.tsx')) {
var tscCode = tsc.transpile(
src,
tsConfig.compilerOptions,
path,
[]
);
return tscCode;
}
return src;
},
};
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"baseUrl": "./src",
"rootDir": "./src",
"declaration": false,
"sourceMap": false,
"inlineSourceMap": true,
"lib": ["es7", "es2017"],
"noUnusedLocals": true,
"noUnusedParameters": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"typeRoots" : [
"./node_modules/@types"
]
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
]
} |
@RaulTsc It would be more helpful if you opened a new issue and created a minimal repo that demostrates this issue. It'll be hard to look into this without something like that |
@kulshekhar Thanks! I will do that! |
sourcemaps are not working for me as well.. |
@kirillgroshkov can you create a minimal repo that demonstrates the issue? It'll be hard to figure out what the problem in your setup is otherwise |
I have the same problem :-( |
I was also struggling with broken sourcemaps, but disabling coverage made them work! I'm using Jest 24.5.0. I just changed my debug script to add |
@villelahdenvuo this is exactly why i love JS :) |
Omg, this works 🎉 |
(this is the first thing that comes up on Google) This is a bug within Jest regarding coverage breaking source maps: |
@rivertam thank you very much for posting the above |
Thanks for the nice package. I have issues making sourcemaps work. I have tried adding --no-cache but I'm still getting error lines of transpiled source (or did I miss anything that console errors should be mapped to correct line?)
Here is my package.json
And here is the tsconfig.test.json
The text was updated successfully, but these errors were encountered: