我想将Jest flow runner与用create-react-app创建的应用程序集成在一起,因为我想同时运行流类型检查和测试用例。
我遵循了Jest platforms video中给出的步骤,并添加了:-
{
"jest": {
"runner": "jest-runner-flowtype"
}
}
在我的package.json
中,却收到了以下消息:-
Out of the box, Create React App only supports overriding these Jest
options:
• collectCoverageFrom
• coverageReporters
• coverageThreshold
• snapshotSerializers.
These options in your package.json Jest configuration are not currently supported by Create React App:
• runner
If 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.
是否可以同时使用jest flow runner
和test runner
玩笑?
我在create-react-app testing guide上阅读,但找不到添加一个跑步者的方法。
更新:
我尝试从create-react-app
弹出并添加了项目选项:-
"projects": [
{
"displayName": "flow",
"runner": "jest-runner-flowtype",
"testMatch": ["<rootDir>/**/*.js"]
}
]
并尝试运行yarn jest --env=jsdom
仍然没有流类型正在显示错误。