-
-
Notifications
You must be signed in to change notification settings - Fork 49.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot test component wrapped with ConfigProvider #26985
Comments
The same issue occurs with export { default as Affix } from './affix';
^^^^^^
SyntaxError: Unexpected token 'export'
import { Tooltip } from 'antd/es'; |
You understand that this kind of arrogant response contribute to your horrible reputation as a dev team, right ? |
For anyone running into this issue, add the following to your "jest": {
"transformIgnorePatterns": [
"/node_modules/(?!antd|rc-.+?|@babel/runtime|@ant-design).+(js|jsx)$"
]
} |
It is not a antd issue but jest usage, I am glad that you find solution and share it. |
I just found another workaround: - import antdLocaleEnUS from 'antd/es/locale/en_US';
+ import antdLocaleEnUS from 'antd/lib/locale/en_US'; |
Other workarounds: |
I've submitted a PR to improve the documentation regarding this issue. I believe it will improve the developer experience with Ant Design. |
It works for
|
Reproduction link
https://github.com/JesusTheHun/antd-cra-rtl-error
Steps to reproduce
yarn test
What is expected?
The test should pass
What is actually happening?
The test fails to start with the error :
The text was updated successfully, but these errors were encountered: