Skip to content

test(@angular/build): add additional unit tests for the i18n inliner - #33778

Open
clydin wants to merge 1 commit into
angular:mainfrom
clydin:test/i18n-inliner-additional-tests
Open

test(@angular/build): add additional unit tests for the i18n inliner#33778
clydin wants to merge 1 commit into
angular:mainfrom
clydin:test/i18n-inliner-additional-tests

Conversation

@clydin

@clydin clydin commented Aug 5, 2026

Copy link
Copy Markdown
Member

Add four unit tests to i18n-inliner_spec.ts to improve test coverage:

  • Verify special characters, quotes, backslashes, and newlines are safely escaped without syntax errors.
  • Verify $localize calls containing placeholder expressions are correctly reconstructed as template literals.
  • Verify multiple $localize calls within the same file are inlined without AST offset drift.
  • Verify parallel multi-threaded inlining across multiple files safely shares and deserializes translation Blobs across worker threads.

@clydin clydin added the target: patch This PR is targeted for the next patch release label Aug 5, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request adds comprehensive unit tests to i18n-inliner_spec.ts to verify that I18nInliner correctly handles special characters, placeholders, multiple $localize calls within a single file, and parallel processing across multiple files. The review feedback suggests improving the robustness of these tests by asserting the exact file contents using .toBe() instead of partial matching with .toContain() to prevent syntax errors or escaping issues.

Comment thread packages/angular/build/src/tools/esbuild/i18n-inliner_spec.ts Outdated
Comment thread packages/angular/build/src/tools/esbuild/i18n-inliner_spec.ts Outdated
Comment thread packages/angular/build/src/tools/esbuild/i18n-inliner_spec.ts
Add four unit tests to `i18n-inliner_spec.ts` to improve test coverage:
- Verify special characters, quotes, backslashes, and newlines are safely escaped without syntax errors.
- Verify $localize calls containing placeholder expressions are correctly reconstructed as template literals.
- Verify multiple $localize calls within the same file are inlined without AST offset drift.
- Verify parallel multi-threaded inlining across multiple files safely shares and deserializes translation Blobs across worker threads.
@clydin
clydin force-pushed the test/i18n-inliner-additional-tests branch from 1cabf81 to 212037e Compare August 5, 2026 19:23
@clydin
clydin requested a review from alan-agius4 August 5, 2026 20:28
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant