调试器为何要求我再次弹出?

时间:2018-10-13 11:12:28

标签: reactjs google-chrome-devtools jestjs create-react-app

我正在绕过create-react-app,只是尝试了弹出选项。在“纱线弹出”之后,我试图通过终端进行调试:

> 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中单击检查链接时,控制台将打开并显示:

  

开箱即用,Create React App仅支持覆盖这些Jest   选项:•collectCoverageFrom•coverageReporters•   coverageThreshold•globalSetup•globalTeardown•resetMocks•   resetModules•snapshotSerializers•watchPathIgnorePatterns。这些   package.json Jest配置中的选项当前不是   受Create React App支持:•解析程序•setupFiles•testMatch   •testEnvironment•testURL•转换•transformIgnorePatterns   •moduleNameMapper•moduleFileExtensions如果要覆盖   其他Jest选项,则需要从默认设置退出。您可以   通过运行npm run exit来做到这一点,但请记住,这是单向的   操作。您也可以向Create React App提交问题以进行讨论   开箱即用地支持更多选项。

这很奇怪,因为我以为我已经进行了弹出?

1 个答案:

答案 0 :(得分:1)

react-scripts是未弹出的create-react-app运行的可执行文件,因此无论是否弹出项目,它都会产生此消息。

npm run eject用实际命令替换弹出项目react-scripts中的scripts。在弹出的项目中,期望npm run test直接执行jest而不是react-scripts test

如果打算向Node提供其他参数,则可能是这样的:

node --inspect-brk node_modules/.bin/jest test --runInBand
相关问题