Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs: instructions to solve v10 compatibility issues with jest #3616

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

Open
pkuczynski wants to merge 1 commit into next
base: next
Choose a base branch
Loading
from migration/jest

Conversation

@pkuczynski
Copy link
Member

@pkuczynski pkuczynski commented Sep 25, 2025

No description provided.

@pkuczynski pkuczynski requested a review from a team as a code owner September 25, 2025 10:27
@pkuczynski pkuczynski self-assigned this Sep 25, 2025
Copy link

netlify bot commented Sep 25, 2025
edited
Loading

Deploy Preview for fakerjs ready!

Name Link
🔨 Latest commit ec43327
🔍 Latest deploy log https://app.netlify.com/projects/fakerjs/deploys/68d5191ed5f8ec0008286e96
😎 Deploy Preview https://deploy-preview-3616.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

codecov bot commented Sep 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.97%. Comparing base (b547045) to head (ec43327).

Additional details and impacted files
@@ Coverage Diff @@
## next #3616 +/- ##
=======================================
 Coverage 99.97% 99.97% 
=======================================
 Files 2894 2894 
 Lines 222390 222390 
 Branches 932 929 -3 
=======================================
 Hits 222337 222337 
 Misses 53 53 
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xDivisionByZerox xDivisionByZerox added the c: docs Improvements or additions to documentation label Sep 25, 2025
Comment on lines +60 to +80
```ts
// Transform both `ts` and `js` files. Defining only `ts` would not be enough, as we also need to transform @faker-js
transform: {
'^.+\\.(t|j)s$': 'ts-jest',

// or when you pass more settings:
'^.+\\.(t|j)s$': [
'ts-jest',
// ... other setttings
]
}

// Exclude from transformation all files in `node_modules`, except `@faker-js`
transformIgnorePatterns: [
// npm
'node_modules/(?!@faker-js).+',

// pnpm
'node_modules/.pnpm/.+/node_modules/(?!@faker-js).+'
],
```
Copy link
Member

@xDivisionByZerox xDivisionByZerox Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change itself looks fine. I was thinking about representing the code block for the config as a Code Group to better differentiate between npm and pnpm packages.
BUT, this documentation only represents a migration option for ts-jest. By default Jest uses babel-jest. Also, the transformer configuration itself is not that important - only that you have one defined for *.js files. That's why I would probably replace the "transform" section in a more generic way, like this:

// Transform both `ts` and `js` files. Defining only `ts` would not be enough, as we also need to transform @faker-js
transform: {
 '^.+\\.(t|j)s$': 'ts-jest', // use the transformer and configuration of your choice
}
// Exclude from transformation all files in `node_modules`, except `@faker-js`
transformIgnorePatterns: [
 // npm
 'node_modules/(?!@faker-js).+',
 // pnpm
 'node_modules/.pnpm/.+/node_modules/(?!@faker-js).+'
],

Copy link
Contributor

Maybe we should try to keep this short and put a longer description and workarounds on https://fakerjs.dev/guide/frameworks.html

Copy link
Member

@pkuczynski are you still interested in providing a solution here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@xDivisionByZerox xDivisionByZerox xDivisionByZerox left review comments

At least 0 approving reviews are required to merge this pull request.

Labels

c: docs Improvements or additions to documentation p: 1-normal Nothing urgent

Projects

None yet

Milestone

v10.x

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /