@vitest/browser 0.24.3 → 0.24.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,11 +16,11 @@
16
16
  document.documentElement.classList.toggle('dark', true)
17
17
  })()
18
18
  </script>
19
- <script type="module" crossorigin src="/__vitest__/assets/index.51497caa.js"></script>
19
+ <script type="module" crossorigin src="/__vitest__/assets/index.75f80b22.js"></script>
20
20
  <link rel="stylesheet" href="/__vitest__/assets/index.3fea3d37.css">
21
21
  </head>
22
22
  <body>
23
23
  <div id="app"></div>
24
24
 
25
25
  </body>
26
- </html>
26
+ </html>
@@ -0,0 +1,41 @@
1
+ (function polyfill() {
2
+ const relList = document.createElement("link").relList;
3
+ if (relList && relList.supports && relList.supports("modulepreload")) {
4
+ return;
5
+ }
6
+ for (const link of document.querySelectorAll('link[rel="modulepreload"]')) {
7
+ processPreload(link);
8
+ }
9
+ new MutationObserver((mutations) => {
10
+ for (const mutation of mutations) {
11
+ if (mutation.type !== "childList") {
12
+ continue;
13
+ }
14
+ for (const node of mutation.addedNodes) {
15
+ if (node.tagName === "LINK" && node.rel === "modulepreload")
16
+ processPreload(node);
17
+ }
18
+ }
19
+ }).observe(document, { childList: true, subtree: true });
20
+ function getFetchOpts(script) {
21
+ const fetchOpts = {};
22
+ if (script.integrity)
23
+ fetchOpts.integrity = script.integrity;
24
+ if (script.referrerpolicy)
25
+ fetchOpts.referrerPolicy = script.referrerpolicy;
26
+ if (script.crossorigin === "use-credentials")
27
+ fetchOpts.credentials = "include";
28
+ else if (script.crossorigin === "anonymous")
29
+ fetchOpts.credentials = "omit";
30
+ else
31
+ fetchOpts.credentials = "same-origin";
32
+ return fetchOpts;
33
+ }
34
+ function processPreload(link) {
35
+ if (link.ep)
36
+ return;
37
+ link.ep = true;
38
+ const fetchOpts = getFetchOpts(link);
39
+ fetch(link.href, fetchOpts);
40
+ }
41
+ })();
@@ -21,7 +21,7 @@
21
21
  border: none;
22
22
  }
23
23
  </style>
24
- <script type="module" crossorigin src="/assets/index.ba53c6ec.js"></script>
24
+ <script type="module" crossorigin src="/assets/index.891d93e6.js"></script>
25
25
  </head>
26
26
  <body>
27
27
  <iframe id="vitest-ui" src=""></iframe>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/browser",
3
3
  "type": "module",
4
- "version": "0.24.3",
4
+ "version": "0.24.5",
5
5
  "description": "Browser running for Vitest",
6
6
  "repository": {
7
7
  "type": "git",
@@ -32,10 +32,10 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/ws": "^8.5.3",
35
- "@vitest/ws-client": "0.24.3",
35
+ "@vitest/ws-client": "0.24.5",
36
36
  "picocolors": "^1.0.0",
37
37
  "rollup": "^2.79.1",
38
- "vitest": "0.24.3"
38
+ "vitest": "0.24.5"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "rimraf dist && pnpm build:node && pnpm build:client && pnpm copy",