Skip to content

refactor: port to unit tests#15644

Merged
ematipico merged 3 commits intomainfrom
refactor/testable-i18n-routing
Feb 26, 2026
Merged

refactor: port to unit tests#15644
ematipico merged 3 commits intomainfrom
refactor/testable-i18n-routing

Conversation

@ematipico
Copy link
Member

@ematipico ematipico commented Feb 24, 2026

Changes

This PR was vibe coded. I checked the implementation code, but I let the AI porting all tests to be unit.

This PR makes the implementation of i18n more testable.

  • Crates a I18nRouter that accepts a context, and emits decisions. Eventually, this decision is given to the middleware, which decides what to do.
  • The fallback is even simpler, it's just a function that accepts some parameters and emits decisions

Note

I kept the existing tests for safety. The next PR will remove them (or next commit)

Testing

Green CI

Docs

Not needed

@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2026

⚠️ No Changeset found

Latest commit: 97a960e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Feb 24, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 24, 2026

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing refactor/testable-i18n-routing (97a960e) with main (5bc2b2c)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (b958dc9) during the generation of this report, so 5bc2b2c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@ematipico ematipico force-pushed the refactor/testable-i18n-routing branch from b9e2e38 to 9ab3046 Compare February 25, 2026 14:46
@ematipico ematipico marked this pull request as ready for review February 25, 2026 14:49
@ematipico ematipico merged commit 35f90eb into main Feb 26, 2026
26 checks passed
@ematipico ematipico deleted the refactor/testable-i18n-routing branch February 26, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants