You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the documentation, browser.testerScripts is a custom script injection feature for the browser environment. The script source and content should be processed by Vite plugins, and this feature seems ideal for injecting polyfills or external libraries required for certain browser tests.
However, when I attempt to inject an external script (in this case, jQuery), the URL is transformed to:
This results in a failed request with a 404 error, as the transformation to the local server address is incorrect for external URLs.
Expected behaviour:
External URLs provided in browser.testerScripts should not be transformed by Vite or should be handled correctly so that the script can be loaded and injected into the browser test environment.
Reproduction
Configure browser.testerScripts with an external script URL, e.g., jQuery:
True, it was added specifically for that. In the next patch, the option will be deprecated and instead, Vitest will use transformIndexHtml (see #6725), so the fix for the future is to inject it in the plugin.
Describe the bug
I am trying to follow the example provided on the Vitest homepage for browser.testerScripts:
According to the documentation, browser.testerScripts is a custom script injection feature for the browser environment. The script source and content should be processed by Vite plugins, and this feature seems ideal for injecting polyfills or external libraries required for certain browser tests.
However, when I attempt to inject an external script (in this case, jQuery), the URL is transformed to:
This results in a failed request with a 404 error, as the transformation to the local server address is incorrect for external URLs.
Expected behaviour:
External URLs provided in browser.testerScripts should not be transformed by Vite or should be handled correctly so that the script can be loaded and injected into the browser test environment.
Reproduction
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: