@vitest/browser 4.0.0-beta.1 → 4.0.0-beta.2
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.
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
})();
|
|
24
24
|
</script>
|
|
25
25
|
<!-- !LOAD_METADATA! -->
|
|
26
|
-
<script type="module" src="./assets/index-
|
|
26
|
+
<script type="module" src="./assets/index-Cil7RPEC.js"></script>
|
|
27
27
|
<link rel="stylesheet" href="./assets/index-KbpJLW--.css">
|
|
28
28
|
</head>
|
|
29
29
|
<body>
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 {
|
|
4
|
+
import { distDir, resolveApiServerConfig, resolveFsAllow, isFileServingAllowed, createDebugger, isValidApiRequest, createViteLogger, createViteServer } from 'vitest/node';
|
|
5
5
|
import fs, { readFileSync, lstatSync, promises, existsSync } from 'node:fs';
|
|
6
6
|
import { createRequire } from 'node:module';
|
|
7
7
|
import { slash as slash$1, toArray, createDefer } from '@vitest/utils';
|
|
@@ -19,7 +19,7 @@ import { WebSocketServer } from 'ws';
|
|
|
19
19
|
import * as nodeos from 'node:os';
|
|
20
20
|
import { performance } from 'node:perf_hooks';
|
|
21
21
|
|
|
22
|
-
var version = "4.0.0-beta.
|
|
22
|
+
var version = "4.0.0-beta.2";
|
|
23
23
|
|
|
24
24
|
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
25
25
|
function normalizeWindowsPath(input = "") {
|
|
@@ -680,8 +680,7 @@ var BrowserPlugin = (parentServer, base = "/") => {
|
|
|
680
680
|
// this plugin can be used in different projects, but all of them
|
|
681
681
|
// have the same `include` pattern, so it doesn't matter which project we use
|
|
682
682
|
const project = parentServer.project;
|
|
683
|
-
const { testFiles:
|
|
684
|
-
const browserTestFiles = allTestFiles.filter((file) => getFilePoolName(project, file) === "browser");
|
|
683
|
+
const { testFiles: browserTestFiles } = await project.globTestFiles();
|
|
685
684
|
const setupFiles = toArray(project.config.setupFiles);
|
|
686
685
|
// replace env values - cannot be reassign at runtime
|
|
687
686
|
const define = {};
|
|
@@ -859,7 +858,7 @@ var BrowserPlugin = (parentServer, base = "/") => {
|
|
|
859
858
|
return;
|
|
860
859
|
}
|
|
861
860
|
const s = new MagicString(code, { filename });
|
|
862
|
-
s.prepend(`import.meta
|
|
861
|
+
s.prepend(`Object.defineProperty(import.meta, 'vitest', { get() { return typeof __vitest_worker__ !== 'undefined' && __vitest_worker__.filepath === "${filename.replace(/"/g, "\\\"")}" ? __vitest_index__ : undefined } });\n`);
|
|
863
862
|
return {
|
|
864
863
|
code: s.toString(),
|
|
865
864
|
map: s.generateMap({ hires: true })
|
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.
|
|
4
|
+
"version": "4.0.0-beta.2",
|
|
5
5
|
"description": "Browser running for Vitest",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://opencollective.com/vitest",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"playwright": "*",
|
|
68
68
|
"webdriverio": "^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
69
|
-
"vitest": "4.0.0-beta.
|
|
69
|
+
"vitest": "4.0.0-beta.2"
|
|
70
70
|
},
|
|
71
71
|
"peerDependenciesMeta": {
|
|
72
72
|
"playwright": {
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"sirv": "^3.0.1",
|
|
87
87
|
"tinyrainbow": "^2.0.0",
|
|
88
88
|
"ws": "^8.18.2",
|
|
89
|
-
"@vitest/mocker": "4.0.0-beta.
|
|
90
|
-
"@vitest/utils": "4.0.0-beta.
|
|
89
|
+
"@vitest/mocker": "4.0.0-beta.2",
|
|
90
|
+
"@vitest/utils": "4.0.0-beta.2"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@types/ws": "^8.18.1",
|
|
@@ -99,14 +99,14 @@
|
|
|
99
99
|
"mime": "^4.0.7",
|
|
100
100
|
"pathe": "^2.0.3",
|
|
101
101
|
"periscopic": "^4.0.2",
|
|
102
|
-
"playwright": "^1.53.
|
|
103
|
-
"playwright-core": "^1.53.
|
|
102
|
+
"playwright": "^1.53.1",
|
|
103
|
+
"playwright-core": "^1.53.1",
|
|
104
104
|
"safaridriver": "^1.0.0",
|
|
105
105
|
"webdriverio": "^9.15.0",
|
|
106
|
-
"@vitest/
|
|
107
|
-
"@vitest/
|
|
108
|
-
"vitest": "4.0.0-beta.
|
|
109
|
-
"
|
|
106
|
+
"@vitest/runner": "4.0.0-beta.2",
|
|
107
|
+
"@vitest/ui": "4.0.0-beta.2",
|
|
108
|
+
"@vitest/ws-client": "4.0.0-beta.2",
|
|
109
|
+
"vitest": "4.0.0-beta.2"
|
|
110
110
|
},
|
|
111
111
|
"scripts": {
|
|
112
112
|
"typecheck": "tsc -p ./src/client/tsconfig.json --noEmit",
|