vitest 0.25.8 → 0.26.0

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.
Files changed (33) hide show
  1. package/LICENSE.md +0 -142
  2. package/dist/browser.d.ts +6 -3
  3. package/dist/browser.js +9 -10
  4. package/dist/{chunk-api-setup.dc71e384.js → chunk-api-setup.08f3b356.js} +39 -42
  5. package/dist/{chunk-integrations-globals.4d261bb8.js → chunk-integrations-globals.cab94a09.js} +5 -5
  6. package/dist/{chunk-runtime-chain.f86e5250.js → chunk-runtime-chain.e655f6cc.js} +4 -5
  7. package/dist/{chunk-runtime-error.616e92ca.js → chunk-runtime-error.dfbbf9be.js} +5 -5
  8. package/dist/{chunk-runtime-mocker.99b910d0.js → chunk-runtime-mocker.35fabb8b.js} +65 -64
  9. package/dist/{chunk-runtime-rpc.42aebbb9.js → chunk-runtime-rpc.7959fc79.js} +1 -1
  10. package/dist/{chunk-runtime-setup.5398e2c4.js → chunk-runtime-setup.4c1b529e.js} +16 -29
  11. package/dist/{chunk-vite-node-externalize.b9495318.js → chunk-snapshot-manager.7d978f79.js} +36 -322
  12. package/dist/{chunk-typecheck-constants.ed987901.js → chunk-typecheck-constants.3f865d14.js} +5 -4
  13. package/dist/{chunk-runtime-test-state.3f86f48f.js → chunk-utils-import.ca62c9d7.js} +49 -18
  14. package/dist/{chunk-utils-source-map.29ff1088.js → chunk-utils-source-map.5bbb50cd.js} +6 -4
  15. package/dist/cli.js +12 -13
  16. package/dist/config.d.ts +4 -1
  17. package/dist/entry.js +9 -9
  18. package/dist/environments.d.ts +4 -1
  19. package/dist/{index-5aad25c1.d.ts → index-c3f83a58.d.ts} +1 -1
  20. package/dist/index.d.ts +28 -10
  21. package/dist/index.js +6 -6
  22. package/dist/loader.js +7 -6
  23. package/dist/node.d.ts +18 -18
  24. package/dist/node.js +14 -14
  25. package/dist/suite.js +4 -4
  26. package/dist/{types-71ccd11d.d.ts → types-56bcd6c3.d.ts} +16 -273
  27. package/dist/vendor-index.783e7f3e.js +71 -0
  28. package/dist/vendor-index.96e022fd.js +211 -0
  29. package/dist/worker.js +12 -14
  30. package/package.json +4 -4
  31. package/dist/chunk-vite-node-source-map.b4ea5792.js +0 -446
  32. package/dist/chunk-vite-node-utils.0e4a6a88.js +0 -1385
  33. package/dist/vendor-source-map-support.1ce17397.js +0 -707
package/LICENSE.md CHANGED
@@ -335,34 +335,6 @@ Repository: micromatch/braces
335
335
 
336
336
  ---------------------------------------
337
337
 
338
- ## buffer-from
339
- License: MIT
340
- Repository: LinusU/buffer-from
341
-
342
- > MIT License
343
- >
344
- > Copyright (c) 2016, 2018 Linus Unnebäck
345
- >
346
- > Permission is hereby granted, free of charge, to any person obtaining a copy
347
- > of this software and associated documentation files (the "Software"), to deal
348
- > in the Software without restriction, including without limitation the rights
349
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
350
- > copies of the Software, and to permit persons to whom the Software is
351
- > furnished to do so, subject to the following conditions:
352
- >
353
- > The above copyright notice and this permission notice shall be included in all
354
- > copies or substantial portions of the Software.
355
- >
356
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
357
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
358
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
359
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
360
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
361
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
362
- > SOFTWARE.
363
-
364
- ---------------------------------------
365
-
366
338
  ## cac
367
339
  License: MIT
368
340
  By: egoist
@@ -1773,57 +1745,6 @@ Repository: micromatch/picomatch
1773
1745
 
1774
1746
  ---------------------------------------
1775
1747
 
1776
- ## pkg-types
1777
- License: MIT
1778
- Repository: unjs/pkg-types
1779
-
1780
- > MIT License
1781
- >
1782
- > Copyright (c) Pooya Parsa <pooya@pi0.io>
1783
- >
1784
- > Permission is hereby granted, free of charge, to any person obtaining a copy
1785
- > of this software and associated documentation files (the "Software"), to deal
1786
- > in the Software without restriction, including without limitation the rights
1787
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1788
- > copies of the Software, and to permit persons to whom the Software is
1789
- > furnished to do so, subject to the following conditions:
1790
- >
1791
- > The above copyright notice and this permission notice shall be included in all
1792
- > copies or substantial portions of the Software.
1793
- >
1794
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1795
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1796
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1797
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1798
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1799
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1800
- > SOFTWARE.
1801
- >
1802
- > --------------------------------------------------------------------------------
1803
- >
1804
- > Copyright Joyent, Inc. and other Node contributors.
1805
- >
1806
- > Permission is hereby granted, free of charge, to any person obtaining a
1807
- > copy of this software and associated documentation files (the
1808
- > "Software"), to deal in the Software without restriction, including
1809
- > without limitation the rights to use, copy, modify, merge, publish,
1810
- > distribute, sublicense, and/or sell copies of the Software, and to permit
1811
- > persons to whom the Software is furnished to do so, subject to the
1812
- > following conditions:
1813
- >
1814
- > The above copyright notice and this permission notice shall be included
1815
- > in all copies or substantial portions of the Software.
1816
- >
1817
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1818
- > OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1819
- > MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
1820
- > NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
1821
- > DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1822
- > OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
1823
- > USE OR OTHER DEALINGS IN THE SOFTWARE.
1824
-
1825
- ---------------------------------------
1826
-
1827
1748
  ## pretty-format
1828
1749
  License: MIT
1829
1750
  By: James Kyle
@@ -2116,34 +2037,6 @@ Repository: chalk/slice-ansi
2116
2037
 
2117
2038
  ---------------------------------------
2118
2039
 
2119
- ## source-map-support
2120
- License: MIT
2121
- Repository: https://github.com/evanw/node-source-map-support
2122
-
2123
- > The MIT License (MIT)
2124
- >
2125
- > Copyright (c) 2014 Evan Wallace
2126
- >
2127
- > Permission is hereby granted, free of charge, to any person obtaining a copy
2128
- > of this software and associated documentation files (the "Software"), to deal
2129
- > in the Software without restriction, including without limitation the rights
2130
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2131
- > copies of the Software, and to permit persons to whom the Software is
2132
- > furnished to do so, subject to the following conditions:
2133
- >
2134
- > The above copyright notice and this permission notice shall be included in all
2135
- > copies or substantial portions of the Software.
2136
- >
2137
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2138
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2139
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2140
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2141
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2142
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2143
- > SOFTWARE.
2144
-
2145
- ---------------------------------------
2146
-
2147
2040
  ## string-width
2148
2041
  License: MIT
2149
2042
  By: Sindre Sorhus
@@ -2251,41 +2144,6 @@ Repository: git+ssh://git@github.com/chaijs/type-detect.git
2251
2144
 
2252
2145
  ---------------------------------------
2253
2146
 
2254
- ## ufo
2255
- License: MIT
2256
- Repository: unjs/ufo
2257
-
2258
- > MIT License
2259
- >
2260
- > Copyright (c) Pooya Parsa <pooya@pi0.io>
2261
- >
2262
- > Permission is hereby granted, free of charge, to any person obtaining a copy
2263
- > of this software and associated documentation files (the "Software"), to deal
2264
- > in the Software without restriction, including without limitation the rights
2265
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2266
- > copies of the Software, and to permit persons to whom the Software is
2267
- > furnished to do so, subject to the following conditions:
2268
- >
2269
- > The above copyright notice and this permission notice shall be included in all
2270
- > copies or substantial portions of the Software.
2271
- >
2272
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2273
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2274
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2275
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2276
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2277
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2278
- > SOFTWARE.
2279
-
2280
- ---------------------------------------
2281
-
2282
- ## vite-node
2283
- License: MIT
2284
- By: Anthony Fu
2285
- Repository: git+https://github.com/vitest-dev/vitest.git
2286
-
2287
- ---------------------------------------
2288
-
2289
2147
  ## which
2290
2148
  License: ISC
2291
2149
  By: Isaac Z. Schlueter
package/dist/browser.d.ts CHANGED
@@ -1,12 +1,15 @@
1
- export { A as AssertType, E as EnhancedSpy, q as ExpectTypeOf, x as Mock, y as MockContext, w as MockInstance, z as Mocked, B as MockedClass, u as MockedFunction, v as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, r as assertType, h as beforeAll, k as beforeEach, n as createExpect, e as describe, m as expect, p as expectTypeOf, i as it, o as onTestFailed, d as suite, t as test } from './index-5aad25c1.js';
2
- import { b as ResolvedConfig } from './types-71ccd11d.js';
3
- export { a1 as AfterSuiteRunMeta, A as ApiConfig, a7 as ArgumentsType, a6 as Arrayable, a4 as Awaitable, ap as BaseCoverageOptions, av as BenchFunction, at as Benchmark, aw as BenchmarkAPI, au as BenchmarkResult, as as BenchmarkUserOptions, B as BuiltinEnvironment, i as CSSModuleScopeStrategy, C as CollectLineNumbers, f as CollectLines, ab as Constructable, h as Context, ar as CoverageC8Options, aq as CoverageIstanbulOptions, an as CoverageOptions, ak as CoverageProvider, al as CoverageProviderModule, am as CoverageReporter, a9 as DeepMerge, D as DoneCallback, ae as Environment, E as EnvironmentOptions, ad as EnvironmentReturn, ai as ErrorWithDiff, a as File, x as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, a8 as MergeInsertions, ac as ModuleCache, M as ModuleGraphData, aa as MutableArray, a5 as Nullable, aj as OnServerRestartHandler, O as OnTestFailedHandler, ah as ParsedStack, ag as Position, d as RawErrsMap, c as Reporter, a0 as ResolveIdFunction, b as ResolvedConfig, ao as ResolvedCoverageOptions, g as RootAndTarget, l as RunMode, R as RuntimeConfig, K as RuntimeContext, S as SequenceHooks, P as SnapshotData, X as SnapshotMatchOptions, Y as SnapshotResult, W as SnapshotStateOptions, _ as SnapshotSummary, Q as SnapshotUpdateState, p as Suite, w as SuiteAPI, z as SuiteCollector, G as SuiteFactory, y as SuiteHooks, s as Task, n as TaskBase, o as TaskResult, T as TaskResultPack, m as TaskState, q as Test, v as TestAPI, L as TestContext, t as TestFunction, u as TestOptions, e as TscErrorInfo, r as TypeCheck, k as TypecheckConfig, Z as UncheckedSnapshot, U as UserConfig, af as UserConsoleLog, N as Vitest, V as VitestEnvironment, j as VitestRunMode, $ as WorkerContext, a3 as WorkerGlobalState, a2 as WorkerRPC } from './types-71ccd11d.js';
1
+ export { A as AssertType, E as EnhancedSpy, q as ExpectTypeOf, x as Mock, y as MockContext, w as MockInstance, z as Mocked, B as MockedClass, u as MockedFunction, v as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, r as assertType, h as beforeAll, k as beforeEach, n as createExpect, e as describe, m as expect, p as expectTypeOf, i as it, o as onTestFailed, d as suite, t as test } from './index-c3f83a58.js';
2
+ import { b as ResolvedConfig } from './types-56bcd6c3.js';
3
+ export { a1 as AfterSuiteRunMeta, A as ApiConfig, a7 as ArgumentsType, a6 as Arrayable, a4 as Awaitable, ap as BaseCoverageOptions, av as BenchFunction, at as Benchmark, aw as BenchmarkAPI, au as BenchmarkResult, as as BenchmarkUserOptions, B as BuiltinEnvironment, i as CSSModuleScopeStrategy, C as CollectLineNumbers, f as CollectLines, ab as Constructable, h as Context, ar as CoverageC8Options, aq as CoverageIstanbulOptions, an as CoverageOptions, ak as CoverageProvider, al as CoverageProviderModule, am as CoverageReporter, a9 as DeepMerge, D as DoneCallback, ae as Environment, E as EnvironmentOptions, ad as EnvironmentReturn, ai as ErrorWithDiff, a as File, x as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, a8 as MergeInsertions, ac as ModuleCache, M as ModuleGraphData, aa as MutableArray, a5 as Nullable, aj as OnServerRestartHandler, O as OnTestFailedHandler, ah as ParsedStack, ag as Position, d as RawErrsMap, c as Reporter, a0 as ResolveIdFunction, b as ResolvedConfig, ao as ResolvedCoverageOptions, g as RootAndTarget, l as RunMode, R as RuntimeConfig, K as RuntimeContext, S as SequenceHooks, P as SnapshotData, X as SnapshotMatchOptions, Y as SnapshotResult, W as SnapshotStateOptions, _ as SnapshotSummary, Q as SnapshotUpdateState, p as Suite, w as SuiteAPI, z as SuiteCollector, G as SuiteFactory, y as SuiteHooks, s as Task, n as TaskBase, o as TaskResult, T as TaskResultPack, m as TaskState, q as Test, v as TestAPI, L as TestContext, t as TestFunction, u as TestOptions, e as TscErrorInfo, r as TypeCheck, k as TypecheckConfig, Z as UncheckedSnapshot, U as UserConfig, af as UserConsoleLog, N as Vitest, V as VitestEnvironment, j as VitestRunMode, $ as WorkerContext, a3 as WorkerGlobalState, a2 as WorkerRPC } from './types-56bcd6c3.js';
4
4
  import * as chai from 'chai';
5
5
  export { chai };
6
6
  export { assert, should } from 'chai';
7
7
  export { Bench as BenchFactory, Options as BenchOptions, Task as BenchTask, TaskResult as BenchTaskResult } from 'tinybench';
8
8
  import 'tinyspy';
9
9
  import 'vite';
10
+ import 'vite-node/client';
11
+ import 'vite-node/server';
12
+ import 'vite-node';
10
13
  import 'fs';
11
14
  import 'worker_threads';
12
15
 
package/dist/browser.js CHANGED
@@ -1,29 +1,28 @@
1
- export { c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.f86e5250.js';
2
- import { e as dist } from './chunk-runtime-test-state.3f86f48f.js';
3
- export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, o as onTestFailed } from './chunk-runtime-test-state.3f86f48f.js';
4
- export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-setup.5398e2c4.js';
1
+ export { c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.e655f6cc.js';
2
+ import { e as dist } from './chunk-utils-import.ca62c9d7.js';
3
+ export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, o as onTestFailed } from './chunk-utils-import.ca62c9d7.js';
4
+ export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-setup.4c1b529e.js';
5
5
  import * as chai from 'chai';
6
6
  export { chai };
7
7
  export { assert, should } from 'chai';
8
8
  import 'util';
9
- import './chunk-typecheck-constants.ed987901.js';
9
+ import './chunk-typecheck-constants.3f865d14.js';
10
10
  import 'path';
11
11
  import './chunk-utils-env.03f840f2.js';
12
12
  import 'tty';
13
13
  import 'url';
14
14
  import 'local-pkg';
15
15
  import './vendor-_commonjsHelpers.addc3445.js';
16
- import './chunk-runtime-rpc.42aebbb9.js';
16
+ import './chunk-runtime-rpc.7959fc79.js';
17
17
  import './chunk-utils-timers.793fd179.js';
18
18
  import 'fs';
19
- import './chunk-utils-source-map.29ff1088.js';
19
+ import './chunk-utils-source-map.5bbb50cd.js';
20
20
  import './spy.js';
21
21
  import 'tinyspy';
22
22
  import 'perf_hooks';
23
23
  import './chunk-integrations-coverage.befed097.js';
24
- import './chunk-runtime-error.616e92ca.js';
25
- import './vendor-source-map-support.1ce17397.js';
26
- import 'source-map';
24
+ import './chunk-runtime-error.dfbbf9be.js';
25
+ import 'vite-node/source-map';
27
26
  import './chunk-env-node.67948209.js';
28
27
  import 'console';
29
28
 
@@ -1,5 +1,5 @@
1
1
  import { promises } from 'fs';
2
- import { c as createBirpc } from './chunk-vite-node-source-map.b4ea5792.js';
2
+ import { c as createBirpc } from './vendor-index.783e7f3e.js';
3
3
  import require$$0$1 from 'stream';
4
4
  import require$$0 from 'zlib';
5
5
  import require$$3 from 'net';
@@ -10,17 +10,44 @@ import require$$1 from 'https';
10
10
  import require$$2$1 from 'http';
11
11
  import url from 'url';
12
12
  import { A as API_PATH } from './chunk-utils-env.03f840f2.js';
13
- import 'module';
14
- import 'vm';
15
- import './chunk-vite-node-utils.0e4a6a88.js';
16
- import 'acorn';
17
- import 'path';
18
- import 'assert';
19
- import 'util';
20
- import 'debug';
21
- import './vendor-source-map-support.1ce17397.js';
22
- import 'source-map';
13
+ import './chunk-typecheck-constants.3f865d14.js';
23
14
  import 'tty';
15
+ import 'path';
16
+ import 'local-pkg';
17
+
18
+ async function getModuleGraph(ctx, id) {
19
+ const graph = {};
20
+ const externalized = /* @__PURE__ */ new Set();
21
+ const inlined = /* @__PURE__ */ new Set();
22
+ function clearId(id2) {
23
+ return (id2 == null ? void 0 : id2.replace(/\?v=\w+$/, "")) || "";
24
+ }
25
+ async function get(mod, seen = /* @__PURE__ */ new Map()) {
26
+ if (!mod || !mod.id)
27
+ return;
28
+ if (seen.has(mod))
29
+ return seen.get(mod);
30
+ let id2 = clearId(mod.id);
31
+ seen.set(mod, id2);
32
+ const rewrote = await ctx.vitenode.shouldExternalize(id2);
33
+ if (rewrote) {
34
+ id2 = rewrote;
35
+ externalized.add(id2);
36
+ seen.set(mod, id2);
37
+ } else {
38
+ inlined.add(id2);
39
+ }
40
+ const mods = Array.from(mod.importedModules).filter((i) => i.id && !i.id.includes("/vitest/dist/"));
41
+ graph[id2] = (await Promise.all(mods.map((m) => get(m, seen)))).filter(Boolean);
42
+ return id2;
43
+ }
44
+ await get(ctx.server.moduleGraph.getModuleById(id));
45
+ return {
46
+ graph,
47
+ externalized: Array.from(externalized),
48
+ inlined: Array.from(inlined)
49
+ };
50
+ }
24
51
 
25
52
  /*! (c) 2020 Andrea Giammarchi */
26
53
 
@@ -4488,37 +4515,7 @@ function setup(ctx) {
4488
4515
  }
4489
4516
  },
4490
4517
  async getModuleGraph(id) {
4491
- const graph = {};
4492
- const externalized = /* @__PURE__ */ new Set();
4493
- const inlined = /* @__PURE__ */ new Set();
4494
- function clearId(id2) {
4495
- return (id2 == null ? void 0 : id2.replace(/\?v=\w+$/, "")) || "";
4496
- }
4497
- async function get(mod, seen = /* @__PURE__ */ new Map()) {
4498
- if (!mod || !mod.id)
4499
- return;
4500
- if (seen.has(mod))
4501
- return seen.get(mod);
4502
- let id2 = clearId(mod.id);
4503
- seen.set(mod, id2);
4504
- const rewrote = await ctx.vitenode.shouldExternalize(id2);
4505
- if (rewrote) {
4506
- id2 = rewrote;
4507
- externalized.add(id2);
4508
- seen.set(mod, id2);
4509
- } else {
4510
- inlined.add(id2);
4511
- }
4512
- const mods = Array.from(mod.importedModules).filter((i) => i.id && !i.id.includes("/vitest/dist/"));
4513
- graph[id2] = (await Promise.all(mods.map((m) => get(m, seen)))).filter(Boolean);
4514
- return id2;
4515
- }
4516
- await get(ctx.server.moduleGraph.getModuleById(id));
4517
- return {
4518
- graph,
4519
- externalized: Array.from(externalized),
4520
- inlined: Array.from(inlined)
4521
- };
4518
+ return getModuleGraph(ctx, id);
4522
4519
  },
4523
4520
  updateSnapshot(file) {
4524
4521
  if (!file)
@@ -1,18 +1,18 @@
1
1
  import { m as globalApis } from './chunk-utils-env.03f840f2.js';
2
- import { i as index } from './chunk-runtime-test-state.3f86f48f.js';
2
+ import { i as index } from './chunk-utils-import.ca62c9d7.js';
3
3
  import 'tty';
4
4
  import 'url';
5
5
  import 'path';
6
- import './chunk-runtime-chain.f86e5250.js';
6
+ import './chunk-runtime-chain.e655f6cc.js';
7
7
  import 'util';
8
8
  import 'chai';
9
- import './chunk-typecheck-constants.ed987901.js';
9
+ import './chunk-typecheck-constants.3f865d14.js';
10
10
  import 'local-pkg';
11
11
  import './vendor-_commonjsHelpers.addc3445.js';
12
- import './chunk-runtime-rpc.42aebbb9.js';
12
+ import './chunk-runtime-rpc.7959fc79.js';
13
13
  import './chunk-utils-timers.793fd179.js';
14
14
  import 'fs';
15
- import './chunk-utils-source-map.29ff1088.js';
15
+ import './chunk-utils-source-map.5bbb50cd.js';
16
16
  import './spy.js';
17
17
  import 'tinyspy';
18
18
 
@@ -1,13 +1,13 @@
1
1
  import util$1 from 'util';
2
2
  import * as chai$2 from 'chai';
3
3
  import { expect, AssertionError, util } from 'chai';
4
- import { i as isObject, b as getCallLastIndex, s as slash, g as getWorkerState, c as getNames, d as assertTypes, e as getFullName, o as objectAttr, n as noop, f as isRunningInTest, h as isRunningInBenchmark } from './chunk-typecheck-constants.ed987901.js';
4
+ import { i as isObject, b as getCallLastIndex, s as slash, g as getWorkerState, c as getNames, d as assertTypes, e as getCurrentEnvironment, f as getFullName, o as objectAttr, n as noop, h as isRunningInTest, j as isRunningInBenchmark } from './chunk-typecheck-constants.3f865d14.js';
5
5
  import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
6
- import { r as rpc } from './chunk-runtime-rpc.42aebbb9.js';
6
+ import { r as rpc } from './chunk-runtime-rpc.7959fc79.js';
7
7
  import fs, { promises } from 'fs';
8
8
  import { j as join, d as dirname, p as picocolors } from './chunk-utils-env.03f840f2.js';
9
9
  import { p as plugins_1, f as format_1, u as unifiedDiff, a as stringify, m as matcherUtils, s as safeSetTimeout, b as safeClearTimeout } from './chunk-utils-timers.793fd179.js';
10
- import { a as posToNumber, n as numberToPos, l as lineSplitRE, p as parseStacktrace } from './chunk-utils-source-map.29ff1088.js';
10
+ import { a as posToNumber, n as numberToPos, l as lineSplitRE, p as parseStacktrace } from './chunk-utils-source-map.5bbb50cd.js';
11
11
  import { isMockFunction } from './spy.js';
12
12
 
13
13
  function createChainable(keys, fn) {
@@ -2077,7 +2077,6 @@ chai$2.use(Subset);
2077
2077
  chai$2.use(SnapshotPlugin);
2078
2078
  chai$2.use(JestAsymmetricMatchers);
2079
2079
 
2080
- const workerState$1 = getWorkerState();
2081
2080
  function createExpect(test) {
2082
2081
  var _a;
2083
2082
  const expect = (value, message) => {
@@ -2098,7 +2097,7 @@ function createExpect(test) {
2098
2097
  isExpectingAssertionsError: null,
2099
2098
  expectedAssertionsNumber: null,
2100
2099
  expectedAssertionsNumberErrorGen: null,
2101
- environment: workerState$1.config.environment,
2100
+ environment: getCurrentEnvironment(),
2102
2101
  testPath: (_a = test == null ? void 0 : test.suite.file) == null ? void 0 : _a.filepath,
2103
2102
  currentTestName: test ? getFullName(test) : void 0
2104
2103
  }, expect);
@@ -1,7 +1,7 @@
1
1
  import util$1 from 'util';
2
2
  import { util } from 'chai';
3
3
  import { a as stringify } from './chunk-utils-timers.793fd179.js';
4
- import { w as deepClone, x as getType } from './chunk-typecheck-constants.ed987901.js';
4
+ import { x as deepClone, y as getType } from './chunk-typecheck-constants.3f865d14.js';
5
5
 
6
6
  const IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@";
7
7
  const IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
@@ -18,7 +18,7 @@ function serializeError(val, seen = /* @__PURE__ */ new WeakMap()) {
18
18
  if (!val || typeof val === "string")
19
19
  return val;
20
20
  if (typeof val === "function")
21
- return `Function<${val.name}>`;
21
+ return `Function<${val.name || "anonymous"}>`;
22
22
  if (typeof val === "symbol")
23
23
  return val.toString();
24
24
  if (typeof val !== "object")
@@ -106,13 +106,13 @@ function isReplaceable(obj1, obj2) {
106
106
  const obj2Type = getType(obj2);
107
107
  return obj1Type === obj2Type && obj1Type === "Object";
108
108
  }
109
- function replaceAsymmetricMatcher(actual, expected, actualReplaced = /* @__PURE__ */ new WeakMap(), expectedReplaced = /* @__PURE__ */ new WeakMap()) {
109
+ function replaceAsymmetricMatcher(actual, expected, actualReplaced = /* @__PURE__ */ new WeakSet(), expectedReplaced = /* @__PURE__ */ new WeakSet()) {
110
110
  if (!isReplaceable(actual, expected))
111
111
  return { replacedActual: actual, replacedExpected: expected };
112
112
  if (actualReplaced.has(actual) || expectedReplaced.has(expected))
113
113
  return { replacedActual: actual, replacedExpected: expected };
114
- actualReplaced.set(actual, true);
115
- expectedReplaced.set(expected, true);
114
+ actualReplaced.add(actual);
115
+ expectedReplaced.add(expected);
116
116
  util.getOwnEnumerableProperties(expected).forEach((key) => {
117
117
  const expectedValue = expected[key];
118
118
  const actualValue = actual[key];