Replies: 2 comments
-
|
Hi @tkalmar, Good catch. You’re right that relying on a jsdom-specific user-agent check is quite fragile and environment-dependent. Disabling devtools based on A possible middle ground could be:
This would make the behavior more predictable and less coupled to a specific DOM implementation. If this addresses your concern, please mark this as answered. If not, let me know what part you’d like to dig into further. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the feedaback! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
i recently stumbled upon
https://github.com/vuejs/core/blame/623bfb29a23c36bf935e7faefa64d1baa69d465c/packages/runtime-core/src/devtools.ts#L67
after switching my vitest environment from jsdom to happy-dom.
Wouldn't it be better if devtools get disabled if NODE_ENV=== 'test'? Only testing for jsdom there is very specific and what happens if jsdom replaces the user-agent? or someone mocks the user-agent with ohter strings? I personally find this very fragile.
Beta Was this translation helpful? Give feedback.
All reactions