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
Custom scripts that should be injected into the index HTML before test iframes are initiated. This HTML document only sets up iframes and doesn't actually import your code.
1621
+
1622
+
The script `src` and `content` will be processed by Vite plugins. Script should be provided in the following shape:
1623
+
1624
+
```ts
1625
+
exportinterfaceBrowserScript {
1626
+
/**
1627
+
* If "content" is provided and type is "module", this will be its identifier.
1628
+
*
1629
+
* If you are using TypeScript, you can add `.ts` extension here for example.
1630
+
* @default`injected-${index}.js`
1631
+
*/
1632
+
id?:string
1633
+
/**
1634
+
* JavaScript content to be injected. This string is processed by Vite plugins if type is "module".
1635
+
*
1636
+
* You can use `id` to give Vite a hint about the file extension.
1637
+
*/
1638
+
content?:string
1639
+
/**
1640
+
* Path to the script. This value is resolved by Vite so it can be a node module or a file path.
Custom scripts that should be injected into the tester HTML before the tests environment is initiated. This is useful to inject polyfills required for Vitest browser implementation. It is recommended to use [`setupFiles`](#setupfiles) in almost all cases instead of this.
1661
+
1662
+
The script `src` and `content` will be processed by Vite plugins.
0 commit comments