[英]How to debug unconverted source code correctly in react18 jest unit test?
Environment:react18 source code, win10, node v16.13.1环境:react18源码,win10,node v16.13.1
I'm using jest tests inside the source code to explore the react18 source code,but jest use babel to convert source code, when i debug jest unit test,it will jump to babel's converted code,it is hard to read,我在源代码中使用jest测试来探索react18源代码,但是jest使用babel转换源代码,当我调试jest单元测试时,它会跳转到babel的转换代码,很难阅读,
So I want to ask is there any way to debug on the source code,not the converted code?所以我想问一下有没有办法在源代码上调试,而不是转换后的代码?
for Example:例如:
when i debug it,it will be converted
当我调试它时,它将被转换
Even in some places,It's almost unreadable:甚至在某些地方,它几乎是不可读的:
i want to debug unconverted source code correctly in react18 jest unit test.我想在 react18 jest 单元测试中正确调试未转换的源代码。
here is my vscode lanuch.json config:这是我的 vscode lanuch.json 配置:
{ "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Jest Current File", "program": "${workspaceFolder}/node_modules/.bin/jest", "args": [ "${fileBasenameNoExtension}", "--config", "./scripts/jest/config.source.js", "--runInBand" ], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", "env": { "NODE_ENV": "development" }, "windows": { "program": "${workspaceFolder}/node_modules/jest/bin/jest", } } ] }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.