Conversation
4b77dbf to
84ce3c0
Compare
Because: - test/mocks.js's untyped shared factories obscure intent and miss type drift (FXA-13708). This commit: - Swaps mocks.mockLog()/mockStatsd() for inline createMock<T>() and adds test/fixtures/fxa-mailer.ts (installMockFxaMailer) across ~60 specs. - Completes the AuthLogger interface and removes the now-dead mockStatsd and mockFxaMailer slices from test/mocks.js. - Breaks a validators <-> cloud-tasks circular dependency the migration exposed (validators now imports ReasonForDeletion from @fxa/shared/cloud-tasks).
nshirley
commented
Jun 8, 2026
| // ./cloud-tasks route module, which re-exports it: ./cloud-tasks imports this | ||
| // validators module, so requiring it here created a circular dependency that | ||
| // left ReasonForDeletion undefined depending on module load order. | ||
| const { ReasonForDeletion } = require('@fxa/shared/cloud-tasks'); |
Contributor
Author
There was a problem hiding this comment.
I'll remove the comment here, but left it for the time being to remind myself.
I suspect, as more things are ripped out of the shared mocks.ts, we'll see this more. There was a hidden circular dependency. The import here was a re-export from the source, but the mocks.ts also imported all of the relevant modules in order, thus loading them into the dependency cache and hiding this problem.
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.
Because:
This commit:
Issue that this pull request solves
Closes: (issue number)
Checklist
Put an
xin the boxes that applyHow to review (Optional)
Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
Any other information that is important to this pull request.