Skip to content

docs(migration): document known limits + transform-allowlist from real runs#66

Merged
danfry1 merged 1 commit into
mainfrom
docs/migration-known-limits
Jul 1, 2026
Merged

docs(migration): document known limits + transform-allowlist from real runs#66
danfry1 merged 1 commit into
mainfrom
docs/migration-known-limits

Conversation

@danfry1

@danfry1 danfry1 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

What

Expands the Migrating from Jest guide with the empirically-derived reality of a real migration, from friction audits across the obytes, react-native-paper, and rneui suites:

  • New "Known limits" section — assertions coupled to Jest's RN mock internals that can't reproduce under a real-RN engine, each with a recommended action:
    • jest.spyOn(View.prototype, 'measure'/'measureInWindow') (real RN's View is a forwardRef, no prototype method)
    • jest.mock('react-native/Libraries/…') of internal submodules + spying them (externalized RN isn't intercepted)
    • raw source-shape assertions (real RN normalizes source)
    • jest.mock('react-native', …) nested in beforeAll/describe callbacks (Jest doesn't hoist those; vitest-native applies mocks more consistently)
  • Expo-core caveat — suites importing Expo core pull in dev-server/init plumbing that expects a Metro connection and may not collect; suites using Expo modules via the expo preset are unaffected.
  • Concrete transform allowlist guidance — the JSX-in-.js third-party-lib parse error (a lib pointing its react-native/module field at untranspiled src/) and the fix (add the package to transform), as the direct replacement for transformIgnorePatterns; also noting vi.mock needs the lib in the Vite graph.

Applied to both the website guide and the packaged docs/ copy so they stay consistent.

Why

The guide already covered the mechanical steps but set the expectation that remaining failures are "usually a missing query update." The audits showed a distinct, nameable class of Jest-mock-coupled assertions that won't port — documenting them sets honest expectations and tells migrators what to rewrite vs. chase.

Validation

  • vitepress build website renders cleanly with these changes.
  • Docs-only; no code paths touched.

Note (separate issue, not in this PR)

While validating, found that website/guide/fidelity.md (a generated file from the fidelity-report pipeline) contains a bare <Text> in a table cell that VitePress parses as an unclosed tag, which breaks vitepress build on main (and thus the Pages deploy). The fix belongs in the report generator (escape/backtick-wrap angle-bracket tokens); filing separately.

…l runs

Expand the Migrating from Jest guide with the empirically-derived reality
of a real migration:

- A 'Known limits' section: assertions coupled to Jest's RN mock internals
  that can't port under a real-RN engine (jest.spyOn(View.prototype, …),
  mocks of RN internal submodules, raw source-shape assertions, jest.mock
  nested in callbacks), with what to do for each.
- An Expo-core caveat (dev-server/init plumbing expects a Metro connection).
- Concrete transform-allowlist guidance: the JSX-in-.js third-party-lib
  parse error and adding the package to transform (the transformIgnorePatterns
  replacement), plus vi.mock needing the lib in the Vite graph.

Applied to both the website guide and the packaged docs copy.
@danfry1 danfry1 merged commit 6c29566 into main Jul 1, 2026
17 checks passed
@danfry1 danfry1 deleted the docs/migration-known-limits branch July 1, 2026 19:43
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.

1 participant