Skip to content

Fix Jest moduleNameMapper pattern order for @objectql/runtime resolution#182

Merged
hotlong merged 2 commits intocopilot/release-new-versionfrom
copilot/check-action-job-status
Jan 24, 2026
Merged

Fix Jest moduleNameMapper pattern order for @objectql/runtime resolution#182
hotlong merged 2 commits intocopilot/release-new-versionfrom
copilot/check-action-job-status

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 24, 2026

Jest test suites in @objectql/core failed to run due to module resolution error: @objectql/runtime was being mapped to the non-existent packages/foundation/runtime/src instead of packages/objectstack/runtime/src.

Changes

Pattern matching order in moduleNameMapper:

  • Moved specific @objectql/runtime pattern before generic @objectql/(.*) pattern
  • Fixed path to point to actual location: ../../objectstack/runtime/src
  • Removed reference to non-existent mock file
 moduleNameMapper: {
+  '^@objectql/runtime$': '<rootDir>/../../objectstack/runtime/src',
   '^@objectql/(.*)$': '<rootDir>/../$1/src',
-  '^@objectql/runtime$': '<rootDir>/test/__mocks__/@objectql/runtime.ts',
 },

The generic pattern was matching first and mapping @objectql/runtime to packages/foundation/runtime/src (doesn't exist). More specific patterns must precede general ones in Jest's moduleNameMapper.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/objectql/objectql/apps/site/node_modules/.bin/../next/dist/bin/next build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

引用: https://github.com/objectstack-ai/objectql/actions/runs/21310697717/job/61346495966#step:10:1


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
objectql-site Ready Ready Preview, Comment Jan 24, 2026 6:37am

Request Review

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Check action job status in objectql Fix Jest moduleNameMapper pattern order for @objectql/runtime resolution Jan 24, 2026
Copilot AI requested a review from hotlong January 24, 2026 06:38
@hotlong hotlong marked this pull request as ready for review January 24, 2026 06:44
Copilot AI review requested due to automatic review settings January 24, 2026 06:44
@hotlong hotlong merged commit 06e8cf2 into copilot/release-new-version Jan 24, 2026
2 checks passed
@hotlong hotlong deleted the copilot/check-action-job-status branch January 24, 2026 06:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Jest module resolution for @objectql/runtime in the @objectql/core package so that core test suites can run against the in-repo runtime implementation instead of a non-existent path.

Changes:

  • Added a specific moduleNameMapper entry for ^@objectql/runtime$ pointing to packages/objectstack/runtime/src.
  • Ordered the specific @objectql/runtime pattern before the generic ^@objectql/(.*)$ mapper to ensure correct matching precedence.
  • Removed the outdated mapping to a non-existent mock file under test/__mocks__/@objectql/runtime.ts.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants