Merged
Conversation
changelog: Internal, Localization, Improve reliability of JavaScript string extraction
mitchellhenke
approved these changes
Jan 21, 2025
zachmargolis
approved these changes
Jan 21, 2025
spec/javascript/support/console.ts
Outdated
Comment on lines
+31
to
+32
| if (message) { | ||
| const index = console.unverifiedCalls.findIndex((calledMessage) => | ||
| const index = (console as ExtendedConsole).unverifiedCalls.findIndex((calledMessage) => |
Contributor
There was a problem hiding this comment.
looks like we have to cast console like 3 times, would it make sense to cast it once?
const logger = console as ExtendedConsole;
Contributor
Author
There was a problem hiding this comment.
looks like we have to cast
consolelike 3 times, would it make sense to cast it once?
Yeah, I was trying to avoid confusion by naming console anything other than console, but you're right that it turned out rather repetitive. I went with your suggestion in 4f15ecb, but then tinkered with it a bit more and landed at 0735056, avoiding assigning to console altogether.
See: https://github.com/18F/identity-idp/pull/11776/files#r1924142466 Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary of changes
Builds upon #11775 to increase visibility of missing translation strings at build-time and in JavaScript-enabled feature tests:
The latter works well in combination with feature test behavior to fail tests where any console logging occurs. Unfortunately most tests which involve document capture disable this behavior (
allow_browser_log: true), but there's at least one which would have caught the original issue (source).📜 Testing Plan
Verify that build passes.
Verify that build fails on a commit between 41f8d41 and 73795c9: