Documentation is not clear about how to use source maps in custom transformers
See original GitHub issue🐛 Bug Report
Documentation is not clear about how to use source maps in custom transformers. Additionally, if you don’t pass any source maps, jest will report a failed assertion in a random position in the original not transformed source code.
To Reproduce
Steps to reproduce the behavior:
- Visit Custom transformers documentation page.
- Create a custom transform following the documentation.
- Create a test that fails.
- See the jest output pointing at a random position in the original source code.
Expected behavior
Inform how the source map should be returned by a custom transformer. If the code was transformed and the source map was not provided, don’t just assume the lines and columns will match.
Link to repl or repo (highly encouraged)
https://repl.it/@fcostarodrigo/JestCustomTransformIssue
I am using CoffeeScript just as an example.
envinfo
System:
OS: Linux 5.4 Debian GNU/Linux 9 (stretch) 9 (stretch)
CPU: (4) x64 Intel(R) Xeon(R) CPU @ 2.30GHz
Binaries:
Node: 12.18.2 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
npmPackages:
jest: ^24.9.0 => 24.9.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Troubleshooting Source Maps for JavaScript
Verify your source maps work locally ... If you find that Sentry is not mapping filename, line, or column mappings correctly, you should...
Read more >Source Maps
If you're writing a custom packager, it's your responsibility to concatenate the source maps of all the assets while packaging. This is done...
Read more >Create source map from typescript api transformation
So, I input my custom file with a custom syntax and use ts.transform function to walk through the AST tree and change what...
Read more >Code Transformation
A transformer is a module that provides a method for transforming source files. For example, if you wanted to be able to use...
Read more >Using Source Maps - Javascript Honeybadger Documentation
The best way to let us know about your source map is to upload your files to our servers every time you deploy...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
#12566 (hopefully clearer now, also #12407)
Can I grab it?