vitest 0.18.0 → 0.18.1
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.
- package/LICENSE.md +1 -1
- package/dist/{chunk-api-setup.63babd7c.mjs → chunk-api-setup.9d3f7670.mjs} +18 -9
- package/dist/{chunk-constants.8eb2ed35.mjs → chunk-constants.d4406290.mjs} +1 -1
- package/dist/{chunk-env-node.26c72624.mjs → chunk-env-node.bbba78e5.mjs} +2 -1
- package/dist/chunk-integrations-globals.00b6e1ad.mjs +23 -0
- package/dist/{chunk-runtime-chain.eb764dff.mjs → chunk-runtime-chain.b60d57da.mjs} +31 -7
- package/dist/{chunk-runtime-mocker.79ccc3de.mjs → chunk-runtime-mocker.1d853e3a.mjs} +70 -22
- package/dist/{chunk-runtime-rpc.cc6a06a2.mjs → chunk-runtime-rpc.9d1f4c48.mjs} +1 -1
- package/dist/{chunk-utils-global.1b22c4fd.mjs → chunk-utils-global.0a7416cf.mjs} +1 -1
- package/dist/{chunk-utils-source-map.957e7756.mjs → chunk-utils-source-map.c03f8bc4.mjs} +1 -1
- package/dist/{chunk-vite-node-externalize.0791f2ed.mjs → chunk-vite-node-externalize.6956d2d9.mjs} +10 -9
- package/dist/chunk-vite-node-utils.8077cd3c.mjs +1422 -0
- package/dist/cli.mjs +7 -7
- package/dist/config.cjs +1 -0
- package/dist/config.mjs +1 -0
- package/dist/entry.mjs +638 -11
- package/dist/index.d.ts +17 -23
- package/dist/index.mjs +8 -8
- package/dist/node.d.ts +9 -16
- package/dist/node.mjs +8 -8
- package/dist/spy.mjs +102 -2
- package/dist/worker.mjs +6 -6
- package/package.json +12 -12
- package/dist/chunk-integrations-globals.61e4d6ae.mjs +0 -26
- package/dist/chunk-integrations-spy.674b628e.mjs +0 -102
- package/dist/chunk-vite-node-utils.af8ead96.mjs +0 -9195
- package/dist/vendor-entry.78de67ab.mjs +0 -660
package/LICENSE.md
CHANGED
|
@@ -1245,7 +1245,7 @@ Repository: unjs/mlly
|
|
|
1245
1245
|
|
|
1246
1246
|
> MIT License
|
|
1247
1247
|
>
|
|
1248
|
-
> Copyright (c)
|
|
1248
|
+
> Copyright (c) 2022 UnJS
|
|
1249
1249
|
>
|
|
1250
1250
|
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1251
1251
|
> of this software and associated documentation files (the "Software"), to deal
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
|
-
import { c as createBirpc } from './chunk-vite-node-utils.
|
|
2
|
+
import { c as createBirpc } from './chunk-vite-node-utils.8077cd3c.mjs';
|
|
3
3
|
import require$$0$1 from 'stream';
|
|
4
4
|
import require$$0 from 'zlib';
|
|
5
5
|
import require$$3 from 'net';
|
|
@@ -9,14 +9,14 @@ import require$$2 from 'events';
|
|
|
9
9
|
import require$$1 from 'https';
|
|
10
10
|
import require$$2$1 from 'http';
|
|
11
11
|
import url from 'url';
|
|
12
|
-
import { A as API_PATH } from './chunk-constants.
|
|
13
|
-
import { j as interpretSourcePos, b as parseStacktrace } from './chunk-utils-source-map.
|
|
12
|
+
import { A as API_PATH } from './chunk-constants.d4406290.mjs';
|
|
13
|
+
import { j as interpretSourcePos, b as parseStacktrace } from './chunk-utils-source-map.c03f8bc4.mjs';
|
|
14
14
|
import 'module';
|
|
15
15
|
import 'vm';
|
|
16
|
-
import './chunk-utils-global.
|
|
16
|
+
import './chunk-utils-global.0a7416cf.mjs';
|
|
17
|
+
import 'path';
|
|
17
18
|
import 'tty';
|
|
18
19
|
import 'local-pkg';
|
|
19
|
-
import 'path';
|
|
20
20
|
import 'assert';
|
|
21
21
|
import 'util';
|
|
22
22
|
import 'debug';
|
|
@@ -3217,11 +3217,11 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
3217
3217
|
? parsedUrl.hostname.slice(1, -1)
|
|
3218
3218
|
: parsedUrl.hostname;
|
|
3219
3219
|
opts.headers = {
|
|
3220
|
+
...opts.headers,
|
|
3220
3221
|
'Sec-WebSocket-Version': opts.protocolVersion,
|
|
3221
3222
|
'Sec-WebSocket-Key': key,
|
|
3222
3223
|
Connection: 'Upgrade',
|
|
3223
|
-
Upgrade: 'websocket'
|
|
3224
|
-
...opts.headers
|
|
3224
|
+
Upgrade: 'websocket'
|
|
3225
3225
|
};
|
|
3226
3226
|
opts.path = parsedUrl.pathname + parsedUrl.search;
|
|
3227
3227
|
opts.timeout = opts.handshakeTimeout;
|
|
@@ -3275,8 +3275,11 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
3275
3275
|
|
|
3276
3276
|
if (opts.followRedirects) {
|
|
3277
3277
|
if (websocket._redirects === 0) {
|
|
3278
|
+
websocket._originalUnixSocket = isUnixSocket;
|
|
3278
3279
|
websocket._originalSecure = isSecure;
|
|
3279
|
-
websocket.
|
|
3280
|
+
websocket._originalHostOrSocketPath = isUnixSocket
|
|
3281
|
+
? opts.socketPath
|
|
3282
|
+
: parsedUrl.host;
|
|
3280
3283
|
|
|
3281
3284
|
const headers = options && options.headers;
|
|
3282
3285
|
|
|
@@ -3292,7 +3295,13 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
3292
3295
|
}
|
|
3293
3296
|
}
|
|
3294
3297
|
} else if (websocket.listenerCount('redirect') === 0) {
|
|
3295
|
-
const isSameHost =
|
|
3298
|
+
const isSameHost = isUnixSocket
|
|
3299
|
+
? websocket._originalUnixSocket
|
|
3300
|
+
? opts.socketPath === websocket._originalHostOrSocketPath
|
|
3301
|
+
: false
|
|
3302
|
+
: websocket._originalUnixSocket
|
|
3303
|
+
? false
|
|
3304
|
+
: parsedUrl.host === websocket._originalHostOrSocketPath;
|
|
3296
3305
|
|
|
3297
3306
|
if (!isSameHost || (websocket._originalSecure && !isSecure)) {
|
|
3298
3307
|
//
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from 'url';
|
|
2
|
-
import { q as resolve } from './chunk-utils-global.
|
|
2
|
+
import { q as resolve } from './chunk-utils-global.0a7416cf.mjs';
|
|
3
3
|
|
|
4
4
|
const distDir = resolve(fileURLToPath(import.meta.url), "../../dist");
|
|
5
5
|
const defaultPort = 51204;
|
|
@@ -2,7 +2,7 @@ import { importModule } from 'local-pkg';
|
|
|
2
2
|
import { existsSync, promises } from 'fs';
|
|
3
3
|
import { createRequire } from 'module';
|
|
4
4
|
import { pathToFileURL } from 'url';
|
|
5
|
-
import { F as toArray, q as resolve } from './chunk-utils-global.
|
|
5
|
+
import { F as toArray, q as resolve } from './chunk-utils-global.0a7416cf.mjs';
|
|
6
6
|
|
|
7
7
|
var node = {
|
|
8
8
|
name: "node",
|
|
@@ -533,6 +533,7 @@ const defaultCoverageExcludes = [
|
|
|
533
533
|
"test{,s}/**",
|
|
534
534
|
"test{,-*}.{js,cjs,mjs,ts,tsx,jsx}",
|
|
535
535
|
"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}",
|
|
536
|
+
"**/*{.,-}spec.{js,cjs,mjs,ts,tsx,jsx}",
|
|
536
537
|
"**/__tests__/**",
|
|
537
538
|
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc}.config.{js,cjs,mjs,ts}",
|
|
538
539
|
"**/.{eslint,mocha,prettier}rc.{js,cjs,yml}"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { g as globalApis } from './chunk-constants.d4406290.mjs';
|
|
2
|
+
import { i as index } from './chunk-runtime-chain.b60d57da.mjs';
|
|
3
|
+
import 'url';
|
|
4
|
+
import './chunk-utils-global.0a7416cf.mjs';
|
|
5
|
+
import 'path';
|
|
6
|
+
import 'tty';
|
|
7
|
+
import 'local-pkg';
|
|
8
|
+
import 'util';
|
|
9
|
+
import 'chai';
|
|
10
|
+
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
11
|
+
import './chunk-runtime-rpc.9d1f4c48.mjs';
|
|
12
|
+
import 'fs';
|
|
13
|
+
import './chunk-utils-source-map.c03f8bc4.mjs';
|
|
14
|
+
import './spy.mjs';
|
|
15
|
+
import 'tinyspy';
|
|
16
|
+
|
|
17
|
+
function registerApiGlobally() {
|
|
18
|
+
globalApis.forEach((api) => {
|
|
19
|
+
globalThis[api] = index[api];
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { registerApiGlobally };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import require$$0, { format } from 'util';
|
|
2
|
+
import { i as isObject, j as join, d as dirname, g as getCallLastIndex, s as slash, a as getWorkerState, b as getNames, c as assertTypes, p as picocolors, e as getFullName, f as safeSetTimeout, h as safeClearTimeout, n as noop, R as RealDate, r as resetDate, m as mockDate, k as resetModules } from './chunk-utils-global.0a7416cf.mjs';
|
|
3
|
+
import chai$1, { expect, AssertionError, util, assert, should } from 'chai';
|
|
2
4
|
import { c as commonjsGlobal } from './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
3
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
4
|
-
import { i as isObject, j as join, d as dirname, g as getCallLastIndex, s as slash, a as getWorkerState, b as getNames, c as assertTypes, p as picocolors, e as getFullName, f as safeSetTimeout, h as safeClearTimeout, n as noop, R as RealDate, r as resetDate, m as mockDate, k as resetModules } from './chunk-utils-global.1b22c4fd.mjs';
|
|
5
|
+
import { r as rpc } from './chunk-runtime-rpc.9d1f4c48.mjs';
|
|
5
6
|
import fs, { promises } from 'fs';
|
|
6
|
-
import { p as plugins_1, f as format_1, g as getOriginalPos, a as posToNumber, n as numberToPos, l as lineSplitRE, b as parseStacktrace, u as unifiedDiff, s as stringify, m as matcherUtils } from './chunk-utils-source-map.
|
|
7
|
-
import {
|
|
8
|
-
import require$$0, { format } from 'util';
|
|
7
|
+
import { p as plugins_1, f as format_1, g as getOriginalPos, a as posToNumber, n as numberToPos, l as lineSplitRE, b as parseStacktrace, u as unifiedDiff, s as stringify, m as matcherUtils } from './chunk-utils-source-map.c03f8bc4.mjs';
|
|
8
|
+
import { isMockFunction, spyOn, fn, spies } from './spy.mjs';
|
|
9
9
|
|
|
10
10
|
function createChainable(keys, fn) {
|
|
11
11
|
function create(obj) {
|
|
@@ -4799,4 +4799,28 @@ function isWatchMode() {
|
|
|
4799
4799
|
return getRunningMode() === "watch";
|
|
4800
4800
|
}
|
|
4801
4801
|
|
|
4802
|
-
|
|
4802
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
4803
|
+
__proto__: null,
|
|
4804
|
+
suite: suite,
|
|
4805
|
+
test: test,
|
|
4806
|
+
describe: describe,
|
|
4807
|
+
it: it,
|
|
4808
|
+
runOnce: runOnce,
|
|
4809
|
+
isFirstRun: isFirstRun,
|
|
4810
|
+
beforeAll: beforeAll,
|
|
4811
|
+
afterAll: afterAll,
|
|
4812
|
+
beforeEach: beforeEach,
|
|
4813
|
+
afterEach: afterEach,
|
|
4814
|
+
withCallback: withCallback,
|
|
4815
|
+
assert: assert,
|
|
4816
|
+
should: should,
|
|
4817
|
+
createExpect: createExpect,
|
|
4818
|
+
chai: chai$1,
|
|
4819
|
+
expect: globalExpect,
|
|
4820
|
+
vitest: vitest,
|
|
4821
|
+
vi: vi,
|
|
4822
|
+
getRunningMode: getRunningMode,
|
|
4823
|
+
isWatchMode: isWatchMode
|
|
4824
|
+
});
|
|
4825
|
+
|
|
4826
|
+
export { getRunningMode as A, isWatchMode as B, GLOBAL_EXPECT as G, collectorContext as a, getSnapshotClient as b, clearCollectorContext as c, defaultSuite as d, setState as e, getFn as f, getHooks as g, getState as h, index as i, suite as j, describe as k, it as l, runOnce as m, isFirstRun as n, beforeAll as o, afterAll as p, beforeEach as q, resetRunOnceCounter as r, setHooks as s, test as t, afterEach as u, vi as v, withCallback as w, createExpect as x, globalExpect as y, vitest as z };
|
|
@@ -1,9 +1,30 @@
|
|
|
1
|
-
import { n as normalizeRequestId, i as isNodeBuiltin, b as toFilePath, V as ViteNodeRunner } from './chunk-vite-node-utils.
|
|
1
|
+
import { n as normalizeRequestId, i as isNodeBuiltin, b as toFilePath, V as ViteNodeRunner } from './chunk-vite-node-utils.8077cd3c.mjs';
|
|
2
2
|
import { normalizePath } from 'vite';
|
|
3
|
-
import { a as getWorkerState, M as isWindows, N as mergeSlashes, d as dirname, j as join, o as basename, q as resolve,
|
|
3
|
+
import { a as getWorkerState, M as isWindows, N as mergeSlashes, d as dirname, j as join, o as basename, q as resolve, s as slash, O as getType, P as getAllProperties } from './chunk-utils-global.0a7416cf.mjs';
|
|
4
4
|
import { existsSync, readdirSync } from 'fs';
|
|
5
|
-
import { d as distDir } from './chunk-constants.
|
|
5
|
+
import { d as distDir } from './chunk-constants.d4406290.mjs';
|
|
6
6
|
|
|
7
|
+
class RefTracker {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.idMap = /* @__PURE__ */ new Map();
|
|
10
|
+
this.mockedValueMap = /* @__PURE__ */ new Map();
|
|
11
|
+
}
|
|
12
|
+
getId(value) {
|
|
13
|
+
return this.idMap.get(value);
|
|
14
|
+
}
|
|
15
|
+
getMockedValue(id) {
|
|
16
|
+
return this.mockedValueMap.get(id);
|
|
17
|
+
}
|
|
18
|
+
track(originalValue, mockedValue) {
|
|
19
|
+
const newId = this.idMap.size;
|
|
20
|
+
this.idMap.set(originalValue, newId);
|
|
21
|
+
this.mockedValueMap.set(newId, mockedValue);
|
|
22
|
+
return newId;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function isSpecialProp(prop, parentType) {
|
|
26
|
+
return parentType.includes("Function") && typeof prop === "string" && ["arguments", "callee", "caller", "length", "name"].includes(prop);
|
|
27
|
+
}
|
|
7
28
|
const _VitestMocker = class {
|
|
8
29
|
constructor(options, moduleCache, request) {
|
|
9
30
|
this.options = options;
|
|
@@ -91,27 +112,54 @@ const _VitestMocker = class {
|
|
|
91
112
|
const fullPath = resolve(dir, "__mocks__", baseId);
|
|
92
113
|
return existsSync(fullPath) ? fullPath : null;
|
|
93
114
|
}
|
|
94
|
-
|
|
115
|
+
mockObject(object) {
|
|
95
116
|
if (!_VitestMocker.spyModule) {
|
|
96
117
|
throw new Error("Error: Spy module is not defined. This is likely an internal bug in Vitest. Please report it to https://github.com/vitest-dev/vitest/issues");
|
|
97
118
|
}
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
119
|
+
const spyModule = _VitestMocker.spyModule;
|
|
120
|
+
const finalizers = new Array();
|
|
121
|
+
const refs = new RefTracker();
|
|
122
|
+
const mockPropertiesOf = (container, newContainer) => {
|
|
123
|
+
const containerType = getType(container);
|
|
124
|
+
const isModule = containerType === "Module" || !!container.__esModule;
|
|
125
|
+
for (const property of getAllProperties(container)) {
|
|
126
|
+
if (!isModule) {
|
|
127
|
+
const descriptor = Object.getOwnPropertyDescriptor(container, property);
|
|
128
|
+
if ((descriptor == null ? void 0 : descriptor.get) || (descriptor == null ? void 0 : descriptor.set))
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (isSpecialProp(property, containerType))
|
|
132
|
+
continue;
|
|
133
|
+
const value = container[property];
|
|
134
|
+
const refId = refs.getId(value);
|
|
135
|
+
if (refId) {
|
|
136
|
+
finalizers.push(() => newContainer[property] = refs.getMockedValue(refId));
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
const type = getType(value);
|
|
140
|
+
if (Array.isArray(value)) {
|
|
141
|
+
newContainer[property] = [];
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
const isFunction = type.includes("Function") && typeof value === "function";
|
|
145
|
+
if ((!isFunction || value.__isMockFunction) && type !== "Object" && type !== "Module") {
|
|
146
|
+
newContainer[property] = value;
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
newContainer[property] = isFunction ? value : {};
|
|
150
|
+
if (isFunction) {
|
|
151
|
+
spyModule.spyOn(newContainer, property).mockImplementation(() => void 0);
|
|
152
|
+
Object.defineProperty(newContainer[property], "length", { value: 0 });
|
|
153
|
+
}
|
|
154
|
+
refs.track(value, newContainer[property]);
|
|
155
|
+
mockPropertiesOf(value, newContainer[property]);
|
|
111
156
|
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
157
|
+
};
|
|
158
|
+
const mockedObject = {};
|
|
159
|
+
mockPropertiesOf(object, mockedObject);
|
|
160
|
+
for (const finalizer of finalizers)
|
|
161
|
+
finalizer();
|
|
162
|
+
return mockedObject;
|
|
115
163
|
}
|
|
116
164
|
unmockPath(path) {
|
|
117
165
|
const suitefile = this.getSuiteFilepath();
|
|
@@ -142,7 +190,7 @@ const _VitestMocker = class {
|
|
|
142
190
|
if (mock === null) {
|
|
143
191
|
await this.ensureSpy();
|
|
144
192
|
const mod = await this.request(fsPath);
|
|
145
|
-
return this.
|
|
193
|
+
return this.mockObject(mod);
|
|
146
194
|
}
|
|
147
195
|
if (typeof mock === "function")
|
|
148
196
|
return this.callFunctionMock(fsPath, mock);
|
|
@@ -168,7 +216,7 @@ const _VitestMocker = class {
|
|
|
168
216
|
return cache.exports;
|
|
169
217
|
const cacheKey = toFilePath(dep, this.root);
|
|
170
218
|
const mod = ((_a = this.moduleCache.get(cacheKey)) == null ? void 0 : _a.exports) || await this.request(dep);
|
|
171
|
-
const exports = this.
|
|
219
|
+
const exports = this.mockObject(mod);
|
|
172
220
|
this.moduleCache.set(cacheName, { exports });
|
|
173
221
|
return exports;
|
|
174
222
|
}
|
package/dist/{chunk-vite-node-externalize.0791f2ed.mjs → chunk-vite-node-externalize.6956d2d9.mjs}
RENAMED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { p as pLimit, c as configDefaults, r as resolveC8Options, a as cleanCoverage, b as reportCoverage, e as envPackageNames } from './chunk-env-node.
|
|
2
|
-
import { j as join, o as basename, d as dirname, q as resolve, A as AggregateErrorPonyfill, p as picocolors,
|
|
1
|
+
import { p as pLimit, c as configDefaults, r as resolveC8Options, a as cleanCoverage, b as reportCoverage, e as envPackageNames } from './chunk-env-node.bbba78e5.mjs';
|
|
2
|
+
import { j as join, o as basename, d as dirname, q as resolve, A as AggregateErrorPonyfill, p as picocolors, t as isAbsolute, u as relative, s as slash$2, v as isNode, x as getTests, e as getFullName, y as hasFailed, z as hasFailedSnapshot, B as safeSetInterval, C as safeClearInterval, D as getSuites, f as safeSetTimeout, E as shuffle, F as toArray$1, G as normalize, n as noop$1, h as safeClearTimeout, H as deepMerge, I as toNamespacedPath, g as getCallLastIndex, l as notNullish, J as ensurePackageInstalled, K as stdout } from './chunk-utils-global.0a7416cf.mjs';
|
|
3
3
|
import { loadConfigFromFile, createServer, mergeConfig } from 'vite';
|
|
4
4
|
import path$a from 'path';
|
|
5
5
|
import url, { fileURLToPath, pathToFileURL } from 'url';
|
|
6
6
|
import process$1 from 'process';
|
|
7
7
|
import fs$8, { promises, existsSync, readFileSync } from 'fs';
|
|
8
|
-
import { d as distDir, c as configFiles, a as defaultPort } from './chunk-constants.
|
|
8
|
+
import { d as distDir, c as configFiles, a as defaultPort } from './chunk-constants.d4406290.mjs';
|
|
9
9
|
import require$$0, { cpus, hostname, constants as constants$5 } from 'os';
|
|
10
10
|
import require$$0$1 from 'util';
|
|
11
11
|
import require$$0$2 from 'stream';
|
|
12
12
|
import require$$2 from 'events';
|
|
13
13
|
import { c as commonjsGlobal } from './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
14
|
-
import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toArray, b as toFilePath, w as withInlineSourcemap, c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-utils.
|
|
14
|
+
import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toArray, b as toFilePath, w as withInlineSourcemap, c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-utils.8077cd3c.mjs';
|
|
15
15
|
import createDebug from 'debug';
|
|
16
16
|
import { MessageChannel } from 'worker_threads';
|
|
17
17
|
import { Tinypool } from 'tinypool';
|
|
18
18
|
import { performance } from 'perf_hooks';
|
|
19
|
-
import { c as stripAnsi, d as cliTruncate, b as parseStacktrace, e as stringWidth, h as ansiStyles, i as sliceAnsi, j as interpretSourcePos, s as stringify$5, u as unifiedDiff, a as posToNumber, l as lineSplitRE } from './chunk-utils-source-map.
|
|
19
|
+
import { c as stripAnsi, d as cliTruncate, b as parseStacktrace, e as stringWidth, h as ansiStyles, i as sliceAnsi, j as interpretSourcePos, s as stringify$5, u as unifiedDiff, a as posToNumber, l as lineSplitRE } from './chunk-utils-source-map.c03f8bc4.mjs';
|
|
20
20
|
import { resolveModule } from 'local-pkg';
|
|
21
21
|
import { createHash } from 'crypto';
|
|
22
22
|
import { Buffer } from 'buffer';
|
|
@@ -26,7 +26,7 @@ import MagicString from './chunk-magic-string.efe26975.mjs';
|
|
|
26
26
|
import require$$0$3 from 'readline';
|
|
27
27
|
import { p as prompts } from './vendor-index.de788b6a.mjs';
|
|
28
28
|
|
|
29
|
-
var version$1 = "0.18.
|
|
29
|
+
var version$1 = "0.18.1";
|
|
30
30
|
|
|
31
31
|
class EndError extends Error {
|
|
32
32
|
constructor(value) {
|
|
@@ -6736,7 +6736,7 @@ function assertPatternsInput(input) {
|
|
|
6736
6736
|
var out = FastGlob;
|
|
6737
6737
|
|
|
6738
6738
|
const ESM_EXT_RE = /\.(es|esm|esm-browser|esm-bundler|es6|module)\.js$/;
|
|
6739
|
-
const ESM_FOLDER_RE = /\/esm\/(.*\.js)$/;
|
|
6739
|
+
const ESM_FOLDER_RE = /\/(es|esm)\/(.*\.js)$/;
|
|
6740
6740
|
const defaultInline = [
|
|
6741
6741
|
/virtual:/,
|
|
6742
6742
|
/\.ts$/
|
|
@@ -6761,6 +6761,7 @@ function guessCJSversion(id) {
|
|
|
6761
6761
|
for (const i of [
|
|
6762
6762
|
id.replace(ESM_FOLDER_RE, "/umd/$1"),
|
|
6763
6763
|
id.replace(ESM_FOLDER_RE, "/cjs/$1"),
|
|
6764
|
+
id.replace(ESM_FOLDER_RE, "/lib/$1"),
|
|
6764
6765
|
id.replace(ESM_FOLDER_RE, "/$1")
|
|
6765
6766
|
]) {
|
|
6766
6767
|
if (existsSync(i))
|
|
@@ -10136,7 +10137,7 @@ createLogUpdate(process$1.stdout);
|
|
|
10136
10137
|
|
|
10137
10138
|
createLogUpdate(process$1.stderr);
|
|
10138
10139
|
|
|
10139
|
-
var version = "0.18.
|
|
10140
|
+
var version = "0.18.1";
|
|
10140
10141
|
|
|
10141
10142
|
function fileFromParsedStack(stack) {
|
|
10142
10143
|
var _a, _b;
|
|
@@ -11065,7 +11066,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest()) {
|
|
|
11065
11066
|
await ctx.setServer(options, server);
|
|
11066
11067
|
haveStarted = true;
|
|
11067
11068
|
if (options.api && options.watch)
|
|
11068
|
-
(await import('./chunk-api-setup.
|
|
11069
|
+
(await import('./chunk-api-setup.9d3f7670.mjs')).setup(ctx);
|
|
11069
11070
|
} catch (err) {
|
|
11070
11071
|
ctx.logger.printError(err, true);
|
|
11071
11072
|
process.exit(1);
|