我正在研究 create-react-app,并尝试了弹出选项。在“yarn eject”之后,我正在尝试通过终端进行调试:
> react-scripts --inspect-brk test --runInBand
Debugger listening on ws://127.0.0.1:9229/45316de1-972e-47ab-9ce8-7ce2f183a378
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
当点击 chrome://inspect/#devices 中的检查链接时,控制台打开并显示:
Out of the box, Create React App only supports overriding these Jest options: • collectCoverageFrom • coverageReporters • coverageThreshold • globalSetup • globalTeardown • resetMocks • resetModules • snapshotSerializers • watchPathIgnorePatterns.These options in your package.json Jest configuration are not currently supported by Create React App: • resolver • setupFiles • testMatch • testEnvironment • testURL • transform • transformIgnorePatterns • moduleNameMapper • moduleFileExtensionsIf you wish to override other Jest options, you need to eject from the default setup. You can do so by running npm run eject but remember that this is a one-way operation. You may also file an issue with Create React App to discuss supporting more options out of the box.
这很奇怪,因为我以为我已经运行了弹出?
最佳答案
react-scripts
是未弹出的 create-react-app
运行的可执行文件,因此无论项目是否被弹出,它都会产生此消息。
npm run eject
将弹出的项目 scripts
中的 react-scripts
替换为实际命令。在弹出的项目中,预计 npm run test
会直接执行 jest
而不是 react-scripts test
。
如果目的是为 Node 提供额外的参数,它可能是这样的:
node --inspect-brk node_modules/.bin/jest test --runInBand
关于reactjs - 为什么调试器要求我再次弹出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52792305/