Enzyme expects an adapter to be configured

前端 未结 15 1560
太阳男子
太阳男子 2020-12-24 04:53

I created a new React application by create-react-app and I wanted to write a unit test to a component named \"MessageBox\" that I created in the application. This is the un

15条回答
  •  执笔经年
    2020-12-24 05:10

    For everyone who read this in the future, setupTestFrameworkScriptFile is deprecated in favor of setupFilesAfterEnv by the documentation, in new versions. We can add our file like this:

    "setupFiles": [
        "/src/setupTests.js"
    ]
    

提交回复
热议问题