这是indexloc提供的服务,不要输入任何密码
Skip to content

fix(example/with-docker): jest can’t resolve @repo/jest-presets/node #10551

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

Merged
merged 2 commits into from
Jun 9, 2025

Conversation

d0lwl0b
Copy link
Contributor

@d0lwl0b d0lwl0b commented Jun 8, 2025

Description

  • Issue
    examples/with-docker/apps/api/package.json and examples/with-docker/packages/logger/package.json both declare
    "preset": "@repo/jest-presets/node", but the TypeScript preset file (jest-preset.ts) is not published, so Jest fails to resolve it.

  • Fix

    1. Replace node/jest-preset.ts with node/jest-preset.js (plain JS, no runtime TS needed).
    2. Update examples/with-docker/packages/jest-presets/package.json:
      • add the JS file to "files"
      • add an "exports" map for ./node and ./node/jest-preset.
  • Outcome
    The preset is now resolvable; tests in apps/api and packages/logger run without errors, with no change in preset behaviour.

Testing Instructions

  1. From examples/with-docker run

    pnpm install
  2. Execute the tests:

    pnpm turbo run test

    or run pnpm jest inside apps/api and packages/logger.

  3. Expectation: no “Cannot find preset '@repo/jest-presets/node'” error; all tests pass.

- switch preset from TS to JS (jest-preset.ts → jest-preset.js)
- update package.json:
  • add JS file to "files"
  • define "exports" map

apps/api & packages/logger can now load the preset without errors.
@d0lwl0b d0lwl0b requested a review from a team as a code owner June 8, 2025 13:52
@turbo-orchestrator turbo-orchestrator bot added area: examples Improvements or additions to examples needs: triage New issues get this label. Remove it after triage labels Jun 8, 2025
Copy link

vercel bot commented Jun 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 9, 2025 5:57pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 9, 2025 5:57pm
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 9, 2025 5:57pm
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 9, 2025 5:57pm
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 9, 2025 5:57pm

Copy link

vercel bot commented Jun 8, 2025

@d0lwl0b is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@d0lwl0b d0lwl0b changed the title fix(example/with-docker): Jest can’t resolve @repo/jest-presets/node fix(example/with-docker): jest can’t resolve @repo/jest-presets/node Jun 8, 2025
Copy link
Contributor

@anthonyshew anthonyshew left a comment

Choose a reason for hiding this comment

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

Thank you!

@anthonyshew anthonyshew enabled auto-merge (squash) June 9, 2025 17:57
@anthonyshew anthonyshew merged commit 5804f61 into vercel:main Jun 9, 2025
26 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: examples Improvements or additions to examples needs: triage New issues get this label. Remove it after triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants