vitest 0.28.5 → 0.29.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 (44) hide show
  1. package/LICENSE.md +1 -1
  2. package/coverage.d.ts +1 -0
  3. package/dist/browser.d.ts +2 -1
  4. package/dist/browser.js +3 -3
  5. package/dist/child.js +89 -0
  6. package/dist/{chunk-api-setup.d88afda6.js → chunk-api-setup.d9eccaeb.js} +3 -3
  7. package/dist/{chunk-env-node.ffd1183b.js → chunk-env-node.affdd278.js} +1 -2
  8. package/dist/{chunk-install-pkg.e1e08354.js → chunk-install-pkg.ea1a5ef4.js} +9 -8
  9. package/dist/chunk-integrations-coverage.e0a6acd2.js +51 -0
  10. package/dist/{chunk-integrations-globals.59432f4f.js → chunk-integrations-globals.b56fcb06.js} +7 -7
  11. package/dist/{chunk-integrations-run-once.38756e30.js → chunk-integrations-run-once.9012f759.js} +1 -1
  12. package/dist/{chunk-integrations-utils.9717ad89.js → chunk-integrations-utils.233d6a3b.js} +2 -2
  13. package/dist/{chunk-node-git.d9ad64ab.js → chunk-node-git.ed5bded8.js} +1 -2
  14. package/dist/{chunk-node-pkg.9a107dfb.js → chunk-node-pkg.88e7e848.js} +4403 -246
  15. package/dist/{chunk-runtime-mocker.dafe0f77.js → chunk-runtime-mocker.a048e92d.js} +63 -13
  16. package/dist/chunk-runtime-rpc.971b3848.js +61 -0
  17. package/dist/{chunk-runtime-setup.30ab0a4b.js → chunk-runtime-setup.992bb661.js} +2 -2
  18. package/dist/{chunk-utils-base.904102a8.js → chunk-utils-base.81f83dbd.js} +15 -1
  19. package/dist/{chunk-utils-global.442d1d33.js → chunk-utils-global.727b6d25.js} +1 -7
  20. package/dist/{chunk-utils-import.847b4a2d.js → chunk-utils-import.ec15dcad.js} +5 -5
  21. package/dist/{chunk-utils-tasks.d07dcea9.js → chunk-utils-tasks.b41c8284.js} +1 -1
  22. package/dist/cli-wrapper.js +1 -2
  23. package/dist/cli.js +12 -11
  24. package/dist/config.cjs +1 -1
  25. package/dist/config.d.ts +8 -7
  26. package/dist/config.js +1 -1
  27. package/dist/coverage.d.ts +142 -0
  28. package/dist/coverage.js +49 -0
  29. package/dist/entry.js +30 -73
  30. package/dist/environments.d.ts +2 -1
  31. package/dist/environments.js +1 -1
  32. package/dist/index.d.ts +3 -2
  33. package/dist/index.js +8 -8
  34. package/dist/loader.js +2 -2
  35. package/dist/node.d.ts +5 -3
  36. package/dist/node.js +13 -12
  37. package/dist/runners.d.ts +2 -1
  38. package/dist/runners.js +5 -5
  39. package/dist/{types-0373403c.d.ts → types-7cd96283.d.ts} +162 -37
  40. package/dist/{vendor-index.618ca5a1.js → vendor-index.2cbcdd1e.js} +18 -13
  41. package/dist/worker.js +12 -53
  42. package/package.json +16 -10
  43. package/dist/chunk-integrations-coverage.48e6286b.js +0 -3993
  44. package/dist/chunk-runtime-rpc.9c0386cc.js +0 -31
@@ -1,31 +0,0 @@
1
- import { getSafeTimers } from '@vitest/utils';
2
- import { g as getWorkerState } from './chunk-utils-global.442d1d33.js';
3
-
4
- const safeRandom = Math.random;
5
- function withSafeTimers(fn) {
6
- const { setTimeout: safeSetTimeout } = getSafeTimers();
7
- const currentSetTimeout = globalThis.setTimeout;
8
- const currentRandom = globalThis.Math.random;
9
- try {
10
- globalThis.setTimeout = safeSetTimeout;
11
- globalThis.Math.random = safeRandom;
12
- const result = fn();
13
- return result;
14
- } finally {
15
- globalThis.setTimeout = currentSetTimeout;
16
- globalThis.Math.random = currentRandom;
17
- }
18
- }
19
- const rpc = () => {
20
- const { rpc: rpc2 } = getWorkerState();
21
- return new Proxy(rpc2, {
22
- get(target, p, handler) {
23
- const sendCall = Reflect.get(target, p, handler);
24
- const safeSendCall = (...args) => withSafeTimers(() => sendCall(...args));
25
- safeSendCall.asEvent = sendCall.asEvent;
26
- return safeSendCall;
27
- }
28
- });
29
- };
30
-
31
- export { rpc as r };