vitest 2.1.1 → 2.1.3

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 (57) hide show
  1. package/LICENSE.md +320 -30
  2. package/dist/browser.d.ts +5 -5
  3. package/dist/browser.js +1 -1
  4. package/dist/chunks/{base.CsQmmYBA.js → base.BO5Jx7vw.js} +1 -1
  5. package/dist/chunks/{base.BlXpj3e_.js → base.DwXGwWst.js} +1 -10
  6. package/dist/chunks/{benchmark.puBFxyfE.d.ts → benchmark.JVlTzojj.d.ts} +2 -0
  7. package/dist/chunks/{cac.BVmpoFAv.js → cac.BSMVokHR.js} +7 -7
  8. package/dist/chunks/cli-api.btGgw3PC.js +11819 -0
  9. package/dist/chunks/{config.CHuotKvS.d.ts → config.Crbj2GAb.d.ts} +3 -0
  10. package/dist/chunks/{console.DI3gHgtH.js → console.CfT1Wjed.js} +1 -1
  11. package/dist/chunks/{creator.BteLTfY8.js → creator.CBPphXqR.js} +4 -7
  12. package/dist/chunks/{environment.C5eAp3K6.d.ts → environment.CzISCQ7o.d.ts} +1 -0
  13. package/dist/chunks/{globals.C03P0O1a.js → globals.Bdzt04Qm.js} +3 -3
  14. package/dist/chunks/index.-d_XpZEA.js +140 -0
  15. package/dist/chunks/{index.DkN6V87F.js → index.4GFF2h22.js} +2 -1
  16. package/dist/chunks/{index.zPibhCkV.js → index.Dz2opmmU.js} +653 -585
  17. package/dist/chunks/{index.Bn75ITYg.js → index.X0nbfr6-.js} +37 -28
  18. package/dist/chunks/{reporters.WnPwkmgA.d.ts → reporters.C4ZHgdxQ.d.ts} +20 -15
  19. package/dist/chunks/{resolveConfig.-K5hHm0S.js → resolveConfig.Dha6ilPI.js} +3544 -3374
  20. package/dist/chunks/{runBaseTests.9YDrdSI4.js → runBaseTests.Cx4wXyTR.js} +6 -6
  21. package/dist/chunks/{setup-common.DV1PI68g.js → setup-common.BKyF15v_.js} +1 -1
  22. package/dist/chunks/{suite.CcK46U-P.d.ts → suite.BMWOKiTe.d.ts} +1 -1
  23. package/dist/chunks/{utils.Dbnmsfq1.js → utils.CY6Spixo.js} +26 -47
  24. package/dist/chunks/vi.BskyZC5g.js +3945 -0
  25. package/dist/chunks/{vite.D2yAwzwa.d.ts → vite.YH7MrecS.d.ts} +1 -1
  26. package/dist/chunks/{vm.CPXwWp4C.js → vm.DB_hLchi.js} +1 -1
  27. package/dist/chunks/{worker.CmPmTxgH.d.ts → worker.B6RjTtbk.d.ts} +42 -28
  28. package/dist/chunks/{worker.Bws9Zuxu.d.ts → worker.CcJLfX8w.d.ts} +1 -1
  29. package/dist/cli.js +2 -2
  30. package/dist/config.cjs +2 -1
  31. package/dist/config.d.ts +19 -14
  32. package/dist/config.js +2 -1
  33. package/dist/coverage.d.ts +67 -30
  34. package/dist/coverage.js +250 -109
  35. package/dist/environments.d.ts +2 -2
  36. package/dist/execute.d.ts +3 -3
  37. package/dist/index.d.ts +36 -19
  38. package/dist/index.js +5 -5
  39. package/dist/node.d.ts +8 -8
  40. package/dist/node.js +10 -9
  41. package/dist/reporters.d.ts +4 -4
  42. package/dist/reporters.js +4 -3
  43. package/dist/runners.d.ts +1 -1
  44. package/dist/runners.js +8 -2
  45. package/dist/suite.d.ts +2 -2
  46. package/dist/worker.js +11 -3
  47. package/dist/workers/forks.js +1 -1
  48. package/dist/workers/runVmTests.js +8 -5
  49. package/dist/workers/threads.js +1 -1
  50. package/dist/workers/vmForks.js +2 -2
  51. package/dist/workers/vmThreads.js +2 -2
  52. package/dist/workers.d.ts +4 -4
  53. package/dist/workers.js +4 -4
  54. package/package.json +12 -13
  55. package/dist/chunks/cli-api.BKkmK21J.js +0 -11404
  56. package/dist/chunks/index.iyKRMe3s.js +0 -131
  57. package/dist/chunks/vi.D6IHiKAI.js +0 -3746
@@ -1,131 +0,0 @@
1
- import { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
2
- import { b as bench } from './benchmark.C8CRJYG4.js';
3
- import { i as isFirstRun, a as runOnce } from './run-once.Sxe67Wng.js';
4
- import { c as createExpect, a as globalExpect, v as vi, b as vitest } from './vi.D6IHiKAI.js';
5
- import { g as getWorkerState } from './utils.Ck2hJTRs.js';
6
- import * as chai from 'chai';
7
- import { assert, should } from 'chai';
8
-
9
- var dist = {};
10
-
11
- (function (exports) {
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.expectTypeOf = void 0;
14
- const fn = () => true;
15
- /**
16
- * Similar to Jest's `expect`, but with type-awareness.
17
- * Gives you access to a number of type-matchers that let you make assertions about the
18
- * form of a reference or generic type parameter.
19
- *
20
- * @example
21
- * import {foo, bar} from '../foo'
22
- * import {expectTypeOf} from 'expect-type'
23
- *
24
- * test('foo types', () => {
25
- * // make sure `foo` has type {a: number}
26
- * expectTypeOf(foo).toMatchTypeOf({a: 1})
27
- * expectTypeOf(foo).toHaveProperty('a').toBeNumber()
28
- *
29
- * // make sure `bar` is a function taking a string:
30
- * expectTypeOf(bar).parameter(0).toBeString()
31
- * expectTypeOf(bar).returns.not.toBeAny()
32
- * })
33
- *
34
- * @description
35
- * See the [full docs](https://npmjs.com/package/expect-type#documentation) for lots more examples.
36
- */
37
- const expectTypeOf = (_actual) => {
38
- const nonFunctionProperties = [
39
- 'parameters',
40
- 'returns',
41
- 'resolves',
42
- 'not',
43
- 'items',
44
- 'constructorParameters',
45
- 'thisParameter',
46
- 'instance',
47
- 'guards',
48
- 'asserts',
49
- 'branded',
50
- ];
51
- const obj = {
52
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
53
- toBeAny: fn,
54
- toBeUnknown: fn,
55
- toBeNever: fn,
56
- toBeFunction: fn,
57
- toBeObject: fn,
58
- toBeArray: fn,
59
- toBeString: fn,
60
- toBeNumber: fn,
61
- toBeBoolean: fn,
62
- toBeVoid: fn,
63
- toBeSymbol: fn,
64
- toBeNull: fn,
65
- toBeUndefined: fn,
66
- toBeNullable: fn,
67
- toMatchTypeOf: fn,
68
- toEqualTypeOf: fn,
69
- toBeCallableWith: fn,
70
- toBeConstructibleWith: fn,
71
- /* eslint-enable @typescript-eslint/no-unsafe-assignment */
72
- extract: exports.expectTypeOf,
73
- exclude: exports.expectTypeOf,
74
- pick: exports.expectTypeOf,
75
- omit: exports.expectTypeOf,
76
- toHaveProperty: exports.expectTypeOf,
77
- parameter: exports.expectTypeOf,
78
- };
79
- const getterProperties = nonFunctionProperties;
80
- getterProperties.forEach((prop) => Object.defineProperty(obj, prop, { get: () => (0, exports.expectTypeOf)({}) }));
81
- return obj;
82
- };
83
- exports.expectTypeOf = expectTypeOf;
84
- } (dist));
85
-
86
- function noop() {
87
- }
88
- const assertType = noop;
89
-
90
- function getRunningMode() {
91
- return process.env.VITEST_MODE === "WATCH" ? "watch" : "run";
92
- }
93
- function isWatchMode() {
94
- return getRunningMode() === "watch";
95
- }
96
-
97
- function inject(key) {
98
- const workerState = getWorkerState();
99
- return workerState.providedContext[key];
100
- }
101
-
102
- var VitestIndex = /*#__PURE__*/Object.freeze({
103
- __proto__: null,
104
- afterAll: afterAll,
105
- afterEach: afterEach,
106
- assert: assert,
107
- assertType: assertType,
108
- beforeAll: beforeAll,
109
- beforeEach: beforeEach,
110
- bench: bench,
111
- chai: chai,
112
- createExpect: createExpect,
113
- describe: describe,
114
- expect: globalExpect,
115
- expectTypeOf: dist.expectTypeOf,
116
- getRunningMode: getRunningMode,
117
- inject: inject,
118
- isFirstRun: isFirstRun,
119
- isWatchMode: isWatchMode,
120
- it: it,
121
- onTestFailed: onTestFailed,
122
- onTestFinished: onTestFinished,
123
- runOnce: runOnce,
124
- should: should,
125
- suite: suite,
126
- test: test,
127
- vi: vi,
128
- vitest: vitest
129
- });
130
-
131
- export { VitestIndex as V, assertType as a, inject as b, dist as d, getRunningMode as g, isWatchMode as i };