-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decouple from TelemetryUTLogger #16466
Decouple from TelemetryUTLogger #16466
Conversation
⯅ @fluid-example/bundle-size-tests: +3.54 KB
Baseline commit: 65c8073 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀. Doesn't have to be in this PR, but this makes me want to add an .assertNoErrors()
API to MockLogger.
deltaStorageService = new OdspDeltaStorageService( | ||
testDeltaStorageUrl, | ||
async (_refresh) => "", | ||
createUtEpochTracker(fileEntry, logger), | ||
logger, | ||
); | ||
}); | ||
afterEach(() => { | ||
logger.assertMatchNone([{ category: "error" }]); | ||
logger.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the methods that check for some condition on the events in the MockLogger
already clear it so this line is not necessary. Not the most intuitive, IMO, but we do have tests that check for events more than once that rely on that behavior today.
I wouldn't be opposed to eventually changing that and making an explicit .clear()
necessary, so I'm fine if we want to keep it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i removed the clears. i think the current behavior is fine. What i really want is to get the mock logger out of the prod package and put it into a test package somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally on board with that. If you get to that point soon, once it's not public API surface anymore I'll follow up with these changes.
…to decouple-utlogger
TelemetryUTLogger is deprecated. This change moves existing usages to the MockLogger.