Skip to content

fix: mock Notion utils in convertInnerUrl tests - #14

Closed
tangly1024 wants to merge 8 commits into
sftbob:mainfrom
tangly1024:codex/fix-jest-esm-notion-utils
Closed

fix: mock Notion utils in convertInnerUrl tests#14
tangly1024 wants to merge 8 commits into
sftbob:mainfrom
tangly1024:codex/fix-jest-esm-notion-utils

Conversation

@tangly1024

@tangly1024 tangly1024 commented Jun 4, 2026

Copy link
Copy Markdown

Summary

  • Mock the notion-utils helper used by convertInnerUrl unit tests.
  • Keep the project free of a root .babelrc, so Next.js/Vercel can continue using SWC for production builds.

Why

After removing the root .babelrc, production builds can use SWC again, but the GitHub Actions unit-test job still runs through Jest. Jest ignores node_modules by default, so it fails when convertInnerUrl imports the ESM build of notion-utils:

SyntaxError: Cannot use import statement outside a module
/node_modules/notion-utils/build/index.js
import "notion-types";

The test only needs idToUuid, so mocking that helper keeps the fix scoped to the unit test and avoids reintroducing project-level Babel configuration.

Validation

  • CI unit tests are expected to cover this directly.

sftbob and others added 7 commits June 4, 2026 02:04
…ve no-implied-eval warning

- Line 157-159: Wrap callback in arrow function for setTimeout to fix @typescript-eslint/no-implied-eval error
- Line 206: Add missing dependencies to useEffect (ADSENSE_GOOGLE_ID, lang, props?.allLinkPages, props?.allNavPages)
…lrc-for-swc-build

fix: restore SWC build by removing Babel config
@netlify

netlify Bot commented Jun 4, 2026

Copy link
Copy Markdown

👷 Deploy request for dashing-tanuki-1cd49d pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit a8d027c

@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the sftbob's projects Team on Vercel.

A member of the Team first needs to authorize it.

@tangly1024
tangly1024 force-pushed the codex/fix-jest-esm-notion-utils branch from a3f8a1e to a8d027c Compare June 4, 2026 11:46
@tangly1024 tangly1024 changed the title fix: transform ESM Notion dependencies in Jest fix: mock Notion utils in convertInnerUrl tests Jun 4, 2026
@github-actions

Copy link
Copy Markdown

此 PR 已超过 30 天无更新,请 rebase 或关闭。

@github-actions github-actions Bot added the stale label Jul 20, 2026
@github-actions github-actions Bot closed this Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants