-
Notifications
You must be signed in to change notification settings - Fork 107
feat(runtime): add startOn environment option #1516
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
base: main
Are you sure you want to change the base?
Conversation
commit: |
|
Iβve realized there are some points I haven't fully considered yet, so Iβll revert this to a draft for further refinement. My apologies. |
1823a5c to
c2fbe7b
Compare
c2fbe7b to
4a89806
Compare
4a89806 to
575fbba
Compare
7e235ea to
297fb17
Compare
|
@yamachi4416 are you on Discord or Bluesky/Twitter? would you mind sending me a DM (nothing bad!)? |
|
It turns out that referencing |
9104a83 to
145cf17
Compare
145cf17 to
e71dfc7
Compare
|
I wish I could have supported |
π Linked issue
this isn't a direct fix, but it now supports the use case in the issue below.
#1496 #1185
β Type of change
π Description
I explored whether we could mock the modules used in our global middleware using the existing setupFile mechanism that starts the NuxtApp. However, I realized that this approach couldn't support both scenarios: mocking the module when the NuxtApp starts and mocking it after it has already started.
To resolve this, I introduced a new startOn option. This allows us to choose the timing for starting the NuxtApp,
which can now be toggled per test file using @vitest-environment-options.Reproductions
stackblitz for issue 1185
expected:
eventBus $on EVENT XXX, theXXXvalues match, andapp.vue - onEvent()is logged.