vitest 2.1.1 → 2.1.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.
Files changed (52) hide show
  1. package/dist/browser.d.ts +5 -5
  2. package/dist/browser.js +1 -1
  3. package/dist/chunks/{base.BlXpj3e_.js → base.DwXGwWst.js} +1 -10
  4. package/dist/chunks/{base.CsQmmYBA.js → base.tiemDJX6.js} +1 -1
  5. package/dist/chunks/{benchmark.puBFxyfE.d.ts → benchmark.JVlTzojj.d.ts} +2 -0
  6. package/dist/chunks/{cac.BVmpoFAv.js → cac.B9PaPYY1.js} +7 -7
  7. package/dist/chunks/cli-api.CHxC4-U8.js +11754 -0
  8. package/dist/chunks/{config.CHuotKvS.d.ts → config.Crbj2GAb.d.ts} +3 -0
  9. package/dist/chunks/{creator.BteLTfY8.js → creator.Cf-MKt9i.js} +4 -7
  10. package/dist/chunks/{environment.C5eAp3K6.d.ts → environment.CzISCQ7o.d.ts} +1 -0
  11. package/dist/chunks/{globals.C03P0O1a.js → globals.HsM2o-0O.js} +3 -3
  12. package/dist/chunks/{index.Bn75ITYg.js → index.BpojBOif.js} +34 -25
  13. package/dist/chunks/{index.DkN6V87F.js → index.Ckn0Cw1h.js} +2 -1
  14. package/dist/chunks/{index.zPibhCkV.js → index.FcPVJkIQ.js} +633 -582
  15. package/dist/chunks/index.mAqbj9F9.js +140 -0
  16. package/dist/chunks/{reporters.WnPwkmgA.d.ts → reporters.DAfKSDh5.d.ts} +17 -12
  17. package/dist/chunks/{resolveConfig.-K5hHm0S.js → resolveConfig.D1DENLPF.js} +3490 -3338
  18. package/dist/chunks/{runBaseTests.9YDrdSI4.js → runBaseTests.D-Gcin7G.js} +5 -5
  19. package/dist/chunks/{setup-common.DV1PI68g.js → setup-common.DF96bIYE.js} +1 -1
  20. package/dist/chunks/{suite.CcK46U-P.d.ts → suite.BMWOKiTe.d.ts} +1 -1
  21. package/dist/chunks/{utils.Dbnmsfq1.js → utils.CY6Spixo.js} +26 -47
  22. package/dist/chunks/vi.DUs2eKik.js +3943 -0
  23. package/dist/chunks/{vite.D2yAwzwa.d.ts → vite.8fk186v-.d.ts} +1 -1
  24. package/dist/chunks/{worker.CmPmTxgH.d.ts → worker.Chrs-_NL.d.ts} +2 -2
  25. package/dist/chunks/{worker.Bws9Zuxu.d.ts → worker.Qtv8v5nL.d.ts} +1 -1
  26. package/dist/cli.js +2 -2
  27. package/dist/config.cjs +2 -1
  28. package/dist/config.d.ts +5 -5
  29. package/dist/config.js +2 -1
  30. package/dist/coverage.d.ts +4 -4
  31. package/dist/coverage.js +2 -2
  32. package/dist/environments.d.ts +2 -2
  33. package/dist/execute.d.ts +3 -3
  34. package/dist/index.d.ts +14 -14
  35. package/dist/index.js +5 -5
  36. package/dist/node.d.ts +8 -8
  37. package/dist/node.js +9 -9
  38. package/dist/reporters.d.ts +4 -4
  39. package/dist/reporters.js +4 -3
  40. package/dist/runners.d.ts +1 -1
  41. package/dist/runners.js +8 -2
  42. package/dist/suite.d.ts +2 -2
  43. package/dist/worker.js +11 -3
  44. package/dist/workers/forks.js +1 -1
  45. package/dist/workers/runVmTests.js +8 -5
  46. package/dist/workers/threads.js +1 -1
  47. package/dist/workers.d.ts +4 -4
  48. package/dist/workers.js +2 -2
  49. package/package.json +11 -12
  50. package/dist/chunks/cli-api.BKkmK21J.js +0 -11404
  51. package/dist/chunks/index.iyKRMe3s.js +0 -131
  52. 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 };