Copy library / What got built / Grok Bot
Grok Bot rescues a failed Dependabot bump by migrating ~110 test files
# Grok Bot 接手失败的 Dependabot 升级:迁移约 110 个测试文件 Source: https://github.com/RichardOrchardOrganisation/QueenZone.Modern/pull/2331 Author: richardorchard Dependabot 把 @testing-library/react-native 升到 14.1.0 后类型检查报 264 个错误。Grok Bot(Codex 起草、复核)改为异步 API,只动测试文件,补了替代已删 API 的辅助函数;typecheck、lint、1350 个 Jest 测试和 expo-doctor 21/21 全部通过,没有删除或跳过测试。
- What it does
- Dependabot's @testing-library/react-native 14.1.0 bump failed typecheck with 264 errors. Grok Bot (draft by Codex, reviewed) moved the tests to the async API, touching test files only, and added helpers for removed APIs. Typecheck, lint, 1,350 Jest tests and expo-doctor 21/21 pass; no tests deleted or skipped.
- Scenarios
- Code & ship
- What the source covers
- Author & original linkYes
- What it doesYes
- Verbatim source excerptYes
- Screenshots / mediaNot in source
- Steps / chaptersYes
- Verbatim prompt / configNot in source
- Results / numbersYes
- Risk notesYes
- Related entriesYes
— means the source doesn't say; we don't fill it in.
- Verbatim source excerpt
Bump @testing-library/react-native to 14.1.0 and migrate tests to async API
## Agent
**Agent:** Grok Bot (draft by Codex, reviewed)
## Summary
Replaces Dependabot PR #2309 (@testing-library/react-native 13.3.3 → 14.1.0). v14 makes rendering async and drops react-test-renderer in favour of `test-renderer`, so #2309 failed typecheck with 264 errors across 56 test files.
- Test files only, about 110 of them: `await` on render / renderHook / rerender / unmount / act / fireEvent / cleanup, and the test callbacks made async to match. `src/test/render.tsx` `renderWithProviders` is now async.Show full post
`jest.setup.ts` awaits `cleanup()`.
- New `src/test/renderer.ts`: `allComponentProps` / `componentProps` / `getHostByType` replace the removed `UNSAFE_getByType` / `findAllByType`. They read composite props from the committed fiber (`screen.root.unstable_fiber`) and require 1 or ≥1 matches.
- package.json: `test-renderer` ^1.3.1 added as an explicit devDependency (v14 peer).
- Separate commit: the Expo SDK 57 patch alignment from #2329, so Expo Doctor passes here as well.
No production source changed. No tests were deleted or skipped. `expect(` lines removed vs added: 62 / 62. @sentry/react-native is unchanged (7.11.0).
## Testing
- [x] `npm run typecheck` (app + tsconfig.test.json): pass
- [x] `npm run lint`: 0 errors (2 warnings that are already there)
- [x] `npx jest`: 163 suites, 1350 tests pass
- [x] `npx expo-doctor`: 21/21
- [ ] Node test runner part of `npm run preflight`: CI (the local box has Node 20)
## Legacy database checks
- [x] Not required for this change
## Verification
- Feature ids: none (test-only migration, no UI source changed)
- Command: `npm run typecheck && npm run lint && npx jest`
- Platform(s): Linux (Jest) and CI
- Result: pass locally; CI run: https://github.com/RichardOrchardOrganisation/QueenZone.Modern/actions?query=branrichardorchard · · Open original ↗ From the project README, verbatim and untranslated.
- Steps / points from the source
- Configuration key: PushNotifications:Apns:Environment
- Environment variable: PushNotificationsApnsEnvironment
- Accepted values are exactly sandbox or production (lowercase, no surrounding whitespace)
- When the setting is absent, Development defaults to sandbox and every other host environment defaults to production
- An explicit value always wins over the host default
- Do not add this key to shared appsettings.json; that would make it explicit in Development and defeat the absent-setting sandbox default
- Merge the PR and wait for deploy-dev.yml to complete (DEV member-auth and DEV journey then start via workflow_run).
- Confirm Nightly RealData, DEV member-auth, and DEV journey are green on that SHA.
Verbatim from the source, untranslated.
- Prompt
The source does not include a prompt you can copy verbatim.
- How to copy
- Open the repo: github.com/RichardOrchardOrganisation/QueenZone.Modern/pull/2331 ↗
- Read the README, send the repo link to your Bot and have it reproduce it
- Get it working small first, then add a routine
- Risks and limits
- Involves payments, orders or bookings: let the bot draft first and act only after you confirm
- Deletes, unsubscribes or cancels things: get a list first and confirm each item
- The author's result may not reproduce for you; the original post is the reference
- Usage estimate
- Estimate with the metal calculator