Skip to content

[codex] regen native dirs in expo config plugin tests#691

Merged
thymikee merged 2 commits intomainfrom
codex/regen-native-dirs-test-fixture
Feb 25, 2026
Merged

[codex] regen native dirs in expo config plugin tests#691
thymikee merged 2 commits intomainfrom
codex/regen-native-dirs-test-fixture

Conversation

@thiagobrez
Copy link
Collaborator

@thiagobrez thiagobrez commented Feb 25, 2026

Summary

This PR removes checked-in native fixture directories (ios/ and android/) from the Expo config plugins test app and changes the plugin test setup to regenerate native directories during test runs using the plugin’s own regenNativeDirs flow.

Problem

The Expo config plugin tests previously copied a fixture app that already contained committed native project files. That meant tests were not validating the plugin’s native regeneration path, and the repository carried a large amount of generated fixture content.

In local environments, tests could also become nondeterministic when developers had locally generated ios/, android/, or node_modules directories inside the fixture app.

User impact

For contributors and maintainers, this improves confidence that tests reflect real plugin behavior (prebuild-style regeneration) and reduces maintenance burden from committed generated files.

Root cause

The test harness used a static fixture copy as test input instead of constructing native directories through the same regeneration code path used by the plugin.

Fix

  • Updated pluginExpoConfigPlugins.test.ts setup to:
    • copy the fixture app to a temp directory,
    • explicitly filter out ios, android, and node_modules during copy to keep test inputs deterministic,
    • seed platform templates into the temp app under node_modules/@rock-js/platform-{ios,android}/template/...,
    • call regenNativeDirs before running assertions.
  • Updated brittle assertions to align with regenerated baselines (e.g. deriving initial bundle identifier from discovered project info).
  • Made withPrimaryColor assertion robust when colors.xml is absent in freshly regenerated template output.
  • Added a fixture README note explaining that native directories are intentionally regenerated and not committed.
  • Removed committed native fixture directories from apps/expo-config-plugins-test-app.

Validation

  • pnpm eslint packages/plugin-expo-config-plugins/src/__tests__/pluginExpoConfigPlugins.test.ts
  • pnpm vitest run packages/plugin-expo-config-plugins/src/__tests__/pluginExpoConfigPlugins.test.ts

Both pass with expected results.

@vercel
Copy link

vercel bot commented Feb 25, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
rock Ignored Ignored Preview Feb 25, 2026 7:25pm

Request Review

@thiagobrez thiagobrez changed the title test: regen native dirs in expo config plugin tests [codex] regen native dirs in expo config plugin tests Feb 25, 2026
@thiagobrez thiagobrez marked this pull request as ready for review February 25, 2026 19:29

describe('plugin applies third-party config plugins correctly', () => {
test('react-native-bottom-tabs', async () => {
test.skip('react-native-bottom-tabs', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

left skip

@thymikee thymikee merged commit 600e56e into main Feb 25, 2026
7 checks passed
@thymikee thymikee deleted the codex/regen-native-dirs-test-fixture branch February 25, 2026 19:34
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.

2 participants