vitest 0.0.107 → 0.0.111

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.
@@ -1,12 +1,19 @@
1
- import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it } from './suite-ff89a82e.js';
2
- import chai, { assert, should, expect } from 'chai';
3
- import { s as spies, a as spyOn, f as fn, v as vitest, b as vi } from './utils-92ec89d1.js';
1
+ import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, b as getState, s as setState, c as suite, t as test, d as describe, i as it, v as vitest, e as vi } from './vi-cb9e4e4e.js';
2
+ import chai, { assert, should } from 'chai';
3
+ import { s as spies, a as spyOn, f as fn } from './jest-mock-a57b745c.js';
4
4
 
5
5
  const beforeAll = (fn, timeout) => getCurrentSuite().on("beforeAll", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
6
6
  const afterAll = (fn, timeout) => getCurrentSuite().on("afterAll", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
7
7
  const beforeEach = (fn, timeout) => getCurrentSuite().on("beforeEach", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
8
8
  const afterEach = (fn, timeout) => getCurrentSuite().on("afterEach", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
9
9
 
10
+ const expect = (value, message) => {
11
+ const { assertionCalls } = getState();
12
+ setState({ assertionCalls: assertionCalls + 1 });
13
+ return chai.expect(value, message);
14
+ };
15
+ Object.assign(expect, chai.expect);
16
+
10
17
  var index = /*#__PURE__*/Object.freeze({
11
18
  __proto__: null,
12
19
  suite: suite,
@@ -19,8 +26,8 @@ var index = /*#__PURE__*/Object.freeze({
19
26
  afterEach: afterEach,
20
27
  assert: assert,
21
28
  should: should,
22
- expect: expect,
23
29
  chai: chai,
30
+ expect: expect,
24
31
  spies: spies,
25
32
  spyOn: spyOn,
26
33
  fn: fn,
@@ -28,4 +35,4 @@ var index = /*#__PURE__*/Object.freeze({
28
35
  vi: vi
29
36
  });
30
37
 
31
- export { afterAll as a, beforeAll as b, beforeEach as c, afterEach as d, index as i };
38
+ export { afterAll as a, beforeAll as b, beforeEach as c, afterEach as d, expect as e, index as i };
@@ -1,4 +1,4 @@
1
- import { q as commonjsGlobal } from './utils-92ec89d1.js';
1
+ import { c as commonjsGlobal } from './_commonjsHelpers-c9e3b764.js';
2
2
  import assert$1 from 'assert';
3
3
  import require$$2 from 'events';
4
4