@vitest/browser 4.0.0-beta.10 → 4.0.0-beta.11

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.
@@ -26,7 +26,7 @@
26
26
  {__VITEST_INJECTOR__}
27
27
  {__VITEST_ERROR_CATCHER__}
28
28
  {__VITEST_SCRIPTS__}
29
- <script type="module" crossorigin src="/__vitest_browser__/orchestrator-BXX6oamz.js"></script>
29
+ <script type="module" crossorigin src="/__vitest_browser__/orchestrator-DOxlOAkk.js"></script>
30
30
  <link rel="modulepreload" crossorigin href="/__vitest_browser__/utils-CPmDBIKG.js">
31
31
  </head>
32
32
  <body>
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" href="{__VITEST_FAVICON__}" type="image/svg+xml">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Vitest Browser Tester</title>
8
- <script type="module" crossorigin src="/__vitest_browser__/tester-CMhJ1E1W.js"></script>
8
+ <script type="module" crossorigin src="/__vitest_browser__/tester-B7fynsGK.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/__vitest_browser__/utils-CPmDBIKG.js">
10
10
  </head>
11
11
  <body>
package/dist/index.js CHANGED
@@ -1,13 +1,12 @@
1
1
  import { ManualMockedModule, RedirectedModule, AutomockedModule, AutospiedModule, MockerRegistry } from '@vitest/mocker';
2
2
  import { dynamicImportPlugin, ServerMockResolver, interceptorPlugin } from '@vitest/mocker/node';
3
3
  import c from 'tinyrainbow';
4
- import { isValidApiRequest, isFileServingAllowed, distDir, resolveApiServerConfig, resolveFsAllow, createDebugger, createViteLogger, createViteServer } from 'vitest/node';
4
+ import { isValidApiRequest, isFileServingAllowed, distDir, resolveApiServerConfig, resolveFsAllow, rolldownVersion, createDebugger, createViteLogger, createViteServer } from 'vitest/node';
5
5
  import fs, { readFileSync, lstatSync, createReadStream, promises, existsSync } from 'node:fs';
6
6
  import { createRequire } from 'node:module';
7
- import { slash as slash$1, toArray, deepMerge, createDefer } from '@vitest/utils';
7
+ import { slash as slash$1, toArray, deepMerge, createDefer } from '@vitest/utils/helpers';
8
8
  import MagicString from 'magic-string';
9
9
  import sirv from 'sirv';
10
- import * as vite from 'vite';
11
10
  import { coverageConfigDefaults } from 'vitest/config';
12
11
  import { fileURLToPath } from 'node:url';
13
12
  import crypto from 'node:crypto';
@@ -23,7 +22,7 @@ import pm from 'pixelmatch';
23
22
  import { WebSocketServer } from 'ws';
24
23
  import { performance } from 'node:perf_hooks';
25
24
 
26
- var version = "4.0.0-beta.10";
25
+ var version = "4.0.0-beta.11";
27
26
 
28
27
  const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
29
28
  function normalizeWindowsPath(input = "") {
@@ -773,7 +772,6 @@ var BrowserPlugin = (parentServer, base = "/") => {
773
772
  const include = [
774
773
  "vitest > expect-type",
775
774
  "vitest > @vitest/snapshot > magic-string",
776
- "vitest > @vitest/runner > strip-literal",
777
775
  "vitest > @vitest/expect > chai",
778
776
  "vitest > @vitest/expect > chai > loupe",
779
777
  "vitest > @vitest/utils > loupe",
@@ -1029,7 +1027,7 @@ body {
1029
1027
  });
1030
1028
  }
1031
1029
  };
1032
- return { optimizeDeps: "rolldownVersion" in vite ? { rollupOptions: { plugins: [rolldownPlugin] } } : { esbuildOptions: { plugins: [esbuildPlugin] } } };
1030
+ return { optimizeDeps: rolldownVersion ? { rollupOptions: { plugins: [rolldownPlugin] } } : { esbuildOptions: { plugins: [esbuildPlugin] } } };
1033
1031
  }
1034
1032
  }
1035
1033
  ];
@@ -3111,18 +3109,19 @@ class ParentBrowserProject {
3111
3109
  return result?.map;
3112
3110
  },
3113
3111
  getUrlId: (id) => {
3114
- const mod = this.vite.moduleGraph.getModuleById(id);
3112
+ const moduleGraph = this.vite.environments.client.moduleGraph;
3113
+ const mod = moduleGraph.getModuleById(id);
3115
3114
  if (mod) {
3116
3115
  return id;
3117
3116
  }
3118
3117
  const resolvedPath = resolve(this.vite.config.root, id.slice(1));
3119
- const modUrl = this.vite.moduleGraph.getModuleById(resolvedPath);
3118
+ const modUrl = moduleGraph.getModuleById(resolvedPath);
3120
3119
  if (modUrl) {
3121
3120
  return resolvedPath;
3122
3121
  }
3123
3122
  // some browsers (looking at you, safari) don't report queries in stack traces
3124
3123
  // the next best thing is to try the first id that this file resolves to
3125
- const files = this.vite.moduleGraph.getModulesByFile(resolvedPath);
3124
+ const files = moduleGraph.getModulesByFile(resolvedPath);
3126
3125
  if (files && files.size) {
3127
3126
  return files.values().next().value.id;
3128
3127
  }
package/dist/state.js CHANGED
@@ -12,7 +12,6 @@
12
12
  const state = {
13
13
  ctx: {
14
14
  pool: "browser",
15
- worker: "./browser.js",
16
15
  workerId: 1,
17
16
  config,
18
17
  projectName: config.name || "",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/browser",
3
3
  "type": "module",
4
- "version": "4.0.0-beta.10",
4
+ "version": "4.0.0-beta.11",
5
5
  "description": "Browser running for Vitest",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",
@@ -58,7 +58,7 @@
58
58
  "peerDependencies": {
59
59
  "playwright": "*",
60
60
  "webdriverio": "^7.0.0 || ^8.0.0 || ^9.0.0",
61
- "vitest": "4.0.0-beta.10"
61
+ "vitest": "4.0.0-beta.11"
62
62
  },
63
63
  "peerDependenciesMeta": {
64
64
  "playwright": {
@@ -74,14 +74,14 @@
74
74
  "dependencies": {
75
75
  "@testing-library/dom": "^10.4.1",
76
76
  "@testing-library/user-event": "^14.6.1",
77
- "magic-string": "^0.30.18",
77
+ "magic-string": "^0.30.19",
78
78
  "pixelmatch": "7.1.0",
79
79
  "pngjs": "^7.0.0",
80
- "sirv": "^3.0.1",
81
- "tinyrainbow": "^2.0.0",
80
+ "sirv": "^3.0.2",
81
+ "tinyrainbow": "^3.0.3",
82
82
  "ws": "^8.18.3",
83
- "@vitest/mocker": "4.0.0-beta.10",
84
- "@vitest/utils": "4.0.0-beta.10"
83
+ "@vitest/mocker": "4.0.0-beta.11",
84
+ "@vitest/utils": "4.0.0-beta.11"
85
85
  },
86
86
  "devDependencies": {
87
87
  "@types/pngjs": "^6.0.5",
@@ -95,8 +95,8 @@
95
95
  "playwright": "^1.55.0",
96
96
  "playwright-core": "^1.55.0",
97
97
  "webdriverio": "^9.19.2",
98
- "@vitest/runner": "4.0.0-beta.10",
99
- "vitest": "4.0.0-beta.10"
98
+ "@vitest/runner": "4.0.0-beta.11",
99
+ "vitest": "4.0.0-beta.11"
100
100
  },
101
101
  "scripts": {
102
102
  "typecheck": "tsc -p ./src/client/tsconfig.json --noEmit",