Skip to content
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

Antd mockings for Jest get broken due to Next.js modularizeImports #1131

Closed
5 tasks done
sabertazimi opened this issue Jul 8, 2023 · 0 comments · Fixed by #1128
Closed
5 tasks done

Antd mockings for Jest get broken due to Next.js modularizeImports #1131

sabertazimi opened this issue Jul 8, 2023 · 0 comments · Fixed by #1128
Assignees
Labels
bug Something isn't working todo 🗒️

Comments

@sabertazimi
Copy link
Owner

sabertazimi commented Jul 8, 2023

Validations

  • Read the contributing guidelines.
  • Follow our code of conduct.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A open a GitHub discussion.

Describe the Bug

Antd mockings for Jest get broken due to Next.js modularizeImports (^13.4.8).
See vercel/next.js#52031, vercel/next.js#52148, vercel/next.js#52169.
and https:/sabertazimi/blog/actions/runs/5493879165/jobs/10012343761.

Reproduction

yarn jest --all

Minimal Example

Expected Behavior

Antd mockings get worked (Disable Antd css-dev-only class name prefix):

// Disable ant design hashed CSS-in-JS class name.
jest.mock('antd', () => {
  const antd = jest.requireActual('antd');
  antd.theme.defaultConfig.hashed = false;
  return antd;
});

System Information

Node: 18.14.2
Yarn: 3.6.1
npm: 9.5.0

Used Package Manager

yarn

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working todo 🗒️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant