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
feat: add service worker scope and worker script URL to "Mocking enabled" message #1172
feat: add service worker scope and worker script URL to "Mocking enabled" message #1172
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit b6e1347:
|
15ff784
to
ec3014f
Compare
scope?: string | ||
workerLocation?: string |
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.
Why are you adding them to PrintStartMessageArgs
?
You don't seem to be using args.workerLocation
or args.scope
anywhere.
You are only using context
e.g. context.worker?.scriptURL
.
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.
You are right, I'm sorry I missed that. Thank you @kettanaito for fixing it.
Hey, @Poivey. Thank you for your work on this! I'd like to look closer at the changes and see if exposing a |
dc373c6
to
8e14f49
Compare
8e14f49
to
fa89d93
Compare
Okay, so what I've tried is I removed the Renamed the commit to |
fa89d93
to
f201a48
Compare
f201a48
to
b6e1347
Compare
Welcome to contributors, @Poivey! 🎉 |
Thank you for reviewing this, @MartinJaskulla! |
…led" message (#1172) * fix: add service worker scope and worker script url to "Mocking enabled" message * chore(printStartMessage): remove context from the function Co-authored-by: Artem Zakharchenko <kettanaito@gmail.com>
…led" message (#1172) * fix: add service worker scope and worker script url to "Mocking enabled" message * chore(printStartMessage): remove context from the function Co-authored-by: Artem Zakharchenko <kettanaito@gmail.com>
…led" message (#1172) * fix: add service worker scope and worker script url to "Mocking enabled" message * chore(printStartMessage): remove context from the function Co-authored-by: Artem Zakharchenko <kettanaito@gmail.com>
Released: v0.40.0 🎉This has been released in v0.40.0! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
…led" message (mswjs#1172) * fix: add service worker scope and worker script url to "Mocking enabled" message * chore(printStartMessage): remove context from the function Co-authored-by: Artem Zakharchenko <kettanaito@gmail.com>
close #1103
As discussed, printing service worker scope & location in "Mocking enabled" message.
Scope and location are found in context to get effective service worker values and not just user raw options.
Question
Do we need to cover cases where these fields would not be present in context (Eg. worker or registration is null) ? I think it should not happen because mocking would not be enabled in this case anyway so we would not print this message, I would like your opinion on that as this is my first PR here.
Screenshot