vitest 0.34.2 → 0.34.4

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 (38) hide show
  1. package/dist/browser.d.ts +3 -3
  2. package/dist/browser.js +1 -1
  3. package/dist/child.js +2 -2
  4. package/dist/{chunk-api-setup.cc5282f7.js → chunk-api-setup.d65b007d.js} +4 -4
  5. package/dist/{chunk-install-pkg.7e19b3a0.js → chunk-install-pkg.b2bdbadc.js} +4 -3
  6. package/dist/{chunk-integrations-globals.522ae1ae.js → chunk-integrations-globals.09bbbed7.js} +3 -3
  7. package/dist/cli.js +9 -8
  8. package/dist/config.cjs +3 -1
  9. package/dist/config.d.ts +3 -3
  10. package/dist/config.js +3 -1
  11. package/dist/coverage.d.ts +3 -3
  12. package/dist/entry-vm.js +3 -3
  13. package/dist/entry.js +6 -3
  14. package/dist/environments.d.ts +3 -3
  15. package/dist/environments.js +1 -1
  16. package/dist/execute.d.ts +3 -3
  17. package/dist/execute.js +1 -1
  18. package/dist/index.d.ts +3 -3
  19. package/dist/index.js +4 -4
  20. package/dist/loader.js +1 -1
  21. package/dist/node.d.ts +4 -4
  22. package/dist/node.js +4 -3
  23. package/dist/{types-63abf2e0.d.ts → reporters-cb94c88b.d.ts} +18 -15
  24. package/dist/reporters.d.ts +16 -0
  25. package/dist/reporters.js +16 -0
  26. package/dist/runners.d.ts +3 -3
  27. package/dist/runners.js +2 -2
  28. package/dist/{vendor-environments.37f266a9.js → vendor-environments.c9c96bf7.js} +16 -4
  29. package/dist/{vendor-execute.4fc8203a.js → vendor-execute.a63e187f.js} +8 -6
  30. package/dist/{vendor-index.087d1af7.js → vendor-index.29282562.js} +1 -1
  31. package/dist/{vendor-index.b5efbd68.js → vendor-index.e951dd92.js} +1 -1
  32. package/dist/{vendor-node.7b1bd3c5.js → vendor-node.b14cb9ad.js} +156 -2669
  33. package/dist/vendor-reporters.f6975b8d.js +2584 -0
  34. package/dist/{vendor-vi.f8055ff2.js → vendor-vi.befc11a6.js} +24 -23
  35. package/dist/vm.js +2 -2
  36. package/dist/worker.js +2 -2
  37. package/package.json +12 -8
  38. package/reporters.d.ts +1 -0
@@ -1,7 +1,7 @@
1
1
  import { getCurrentSuite, getCurrentTest } from '@vitest/runner';
2
2
  import { createChainable, getNames } from '@vitest/runner/utils';
3
3
  import { getSafeTimers, noop, assertTypes, createSimpleStackTrace } from '@vitest/utils';
4
- import { i as isRunningInBenchmark } from './vendor-index.087d1af7.js';
4
+ import { i as isRunningInBenchmark } from './vendor-index.29282562.js';
5
5
  import * as chai$1 from 'chai';
6
6
  import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './vendor-_commonjsHelpers.7d1333e8.js';
7
7
  import { equals, iterableEquality, subsetEquality, JestExtend, JestChaiExpect, JestAsymmetricMatchers, GLOBAL_EXPECT as GLOBAL_EXPECT$1, getState, setState } from '@vitest/expect';
@@ -3205,7 +3205,7 @@ function createVitest() {
3205
3205
  const stack = parseSingleStack(importerStack);
3206
3206
  return (stack == null ? void 0 : stack.file) || "";
3207
3207
  };
3208
- return {
3208
+ const utils = {
3209
3209
  useFakeTimers(config) {
3210
3210
  if (config) {
3211
3211
  _timers.configure(config);
@@ -3214,48 +3214,48 @@ function createVitest() {
3214
3214
  _timers.configure(workerState2.config.fakeTimers);
3215
3215
  }
3216
3216
  _timers.useFakeTimers();
3217
- return this;
3217
+ return utils;
3218
3218
  },
3219
3219
  useRealTimers() {
3220
3220
  _timers.useRealTimers();
3221
3221
  _mockedDate = null;
3222
- return this;
3222
+ return utils;
3223
3223
  },
3224
3224
  runOnlyPendingTimers() {
3225
3225
  _timers.runOnlyPendingTimers();
3226
- return this;
3226
+ return utils;
3227
3227
  },
3228
3228
  async runOnlyPendingTimersAsync() {
3229
3229
  await _timers.runOnlyPendingTimersAsync();
3230
- return this;
3230
+ return utils;
3231
3231
  },
3232
3232
  runAllTimers() {
3233
3233
  _timers.runAllTimers();
3234
- return this;
3234
+ return utils;
3235
3235
  },
3236
3236
  async runAllTimersAsync() {
3237
3237
  await _timers.runAllTimersAsync();
3238
- return this;
3238
+ return utils;
3239
3239
  },
3240
3240
  runAllTicks() {
3241
3241
  _timers.runAllTicks();
3242
- return this;
3242
+ return utils;
3243
3243
  },
3244
3244
  advanceTimersByTime(ms) {
3245
3245
  _timers.advanceTimersByTime(ms);
3246
- return this;
3246
+ return utils;
3247
3247
  },
3248
3248
  async advanceTimersByTimeAsync(ms) {
3249
3249
  await _timers.advanceTimersByTimeAsync(ms);
3250
- return this;
3250
+ return utils;
3251
3251
  },
3252
3252
  advanceTimersToNextTimer() {
3253
3253
  _timers.advanceTimersToNextTimer();
3254
- return this;
3254
+ return utils;
3255
3255
  },
3256
3256
  async advanceTimersToNextTimerAsync() {
3257
3257
  await _timers.advanceTimersToNextTimerAsync();
3258
- return this;
3258
+ return utils;
3259
3259
  },
3260
3260
  getTimerCount() {
3261
3261
  return _timers.getTimerCount();
@@ -3264,7 +3264,7 @@ function createVitest() {
3264
3264
  const date = time instanceof Date ? time : new Date(time);
3265
3265
  _mockedDate = date;
3266
3266
  _timers.setSystemTime(date);
3267
- return this;
3267
+ return utils;
3268
3268
  },
3269
3269
  getMockedSystemTime() {
3270
3270
  return _mockedDate;
@@ -3274,7 +3274,7 @@ function createVitest() {
3274
3274
  },
3275
3275
  clearAllTimers() {
3276
3276
  _timers.clearAllTimers();
3277
- return this;
3277
+ return utils;
3278
3278
  },
3279
3279
  // mocks
3280
3280
  spyOn,
@@ -3314,15 +3314,15 @@ function createVitest() {
3314
3314
  },
3315
3315
  clearAllMocks() {
3316
3316
  spies.forEach((spy) => spy.mockClear());
3317
- return this;
3317
+ return utils;
3318
3318
  },
3319
3319
  resetAllMocks() {
3320
3320
  spies.forEach((spy) => spy.mockReset());
3321
- return this;
3321
+ return utils;
3322
3322
  },
3323
3323
  restoreAllMocks() {
3324
3324
  spies.forEach((spy) => spy.mockRestore());
3325
- return this;
3325
+ return utils;
3326
3326
  },
3327
3327
  stubGlobal(name, value) {
3328
3328
  if (!_stubsGlobal.has(name))
@@ -3333,13 +3333,13 @@ function createVitest() {
3333
3333
  configurable: true,
3334
3334
  enumerable: true
3335
3335
  });
3336
- return this;
3336
+ return utils;
3337
3337
  },
3338
3338
  stubEnv(name, value) {
3339
3339
  if (!_stubsEnv.has(name))
3340
3340
  _stubsEnv.set(name, process.env[name]);
3341
3341
  process.env[name] = value;
3342
- return this;
3342
+ return utils;
3343
3343
  },
3344
3344
  unstubAllGlobals() {
3345
3345
  _stubsGlobal.forEach((original, name) => {
@@ -3349,7 +3349,7 @@ function createVitest() {
3349
3349
  Object.defineProperty(globalThis, name, original);
3350
3350
  });
3351
3351
  _stubsGlobal.clear();
3352
- return this;
3352
+ return utils;
3353
3353
  },
3354
3354
  unstubAllEnvs() {
3355
3355
  _stubsEnv.forEach((original, name) => {
@@ -3359,12 +3359,12 @@ function createVitest() {
3359
3359
  process.env[name] = original;
3360
3360
  });
3361
3361
  _stubsEnv.clear();
3362
- return this;
3362
+ return utils;
3363
3363
  },
3364
3364
  resetModules() {
3365
3365
  const state = getWorkerState();
3366
3366
  resetModules(state.moduleCache);
3367
- return this;
3367
+ return utils;
3368
3368
  },
3369
3369
  async dynamicImportSettled() {
3370
3370
  return waitForImportsToResolve();
@@ -3382,6 +3382,7 @@ function createVitest() {
3382
3382
  }
3383
3383
  }
3384
3384
  };
3385
+ return utils;
3385
3386
  }
3386
3387
  const vitest = createVitest();
3387
3388
  const vi = vitest;
package/dist/vm.js CHANGED
@@ -7,8 +7,8 @@ import { c as createBirpc } from './vendor-index.b271ebe4.js';
7
7
  import { resolve } from 'pathe';
8
8
  import { installSourcemapsSupport } from 'vite-node/source-map';
9
9
  import { d as distDir } from './vendor-paths.84fc7a99.js';
10
- import { l as loadEnvironment } from './vendor-environments.37f266a9.js';
11
- import { b as startVitestExecutor } from './vendor-execute.4fc8203a.js';
10
+ import { l as loadEnvironment } from './vendor-environments.c9c96bf7.js';
11
+ import { b as startVitestExecutor } from './vendor-execute.a63e187f.js';
12
12
  import { createCustomConsole } from './chunk-runtime-console.ea222ffb.js';
13
13
  import { c as createSafeRpc } from './vendor-rpc.cbd8e972.js';
14
14
  import './vendor-index.0b5b3600.js';
package/dist/worker.js CHANGED
@@ -2,8 +2,8 @@ import { performance } from 'node:perf_hooks';
2
2
  import { c as createBirpc } from './vendor-index.b271ebe4.js';
3
3
  import { workerId } from 'tinypool';
4
4
  import { g as getWorkerState } from './vendor-global.97e4527c.js';
5
- import { l as loadEnvironment } from './vendor-environments.37f266a9.js';
6
- import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor-execute.4fc8203a.js';
5
+ import { l as loadEnvironment } from './vendor-environments.c9c96bf7.js';
6
+ import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor-execute.a63e187f.js';
7
7
  import { s as setupInspect } from './vendor-inspector.47fc8cbb.js';
8
8
  import { r as rpcDone, c as createSafeRpc } from './vendor-rpc.cbd8e972.js';
9
9
  import 'node:url';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "0.34.2",
4
+ "version": "0.34.4",
5
5
  "description": "A blazing fast unit test framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -77,6 +77,10 @@
77
77
  "./coverage": {
78
78
  "types": "./coverage.d.ts",
79
79
  "import": "./dist/coverage.js"
80
+ },
81
+ "./reporters": {
82
+ "types": "./dist/reporters.d.ts",
83
+ "import": "./dist/reporters.js"
80
84
  }
81
85
  },
82
86
  "main": "./dist/index.js",
@@ -149,14 +153,14 @@
149
153
  "strip-literal": "^1.0.1",
150
154
  "tinybench": "^2.5.0",
151
155
  "tinypool": "^0.7.0",
152
- "vite": "^3.0.0 || ^4.0.0",
156
+ "vite": "^3.1.0 || ^4.0.0 || ^5.0.0-0",
153
157
  "why-is-node-running": "^2.2.2",
154
- "@vitest/runner": "0.34.2",
155
- "@vitest/utils": "0.34.2",
156
- "vite-node": "0.34.2",
157
- "@vitest/expect": "0.34.2",
158
- "@vitest/spy": "0.34.2",
159
- "@vitest/snapshot": "0.34.2"
158
+ "@vitest/runner": "0.34.4",
159
+ "@vitest/snapshot": "0.34.4",
160
+ "vite-node": "0.34.4",
161
+ "@vitest/utils": "0.34.4",
162
+ "@vitest/expect": "0.34.4",
163
+ "@vitest/spy": "0.34.4"
160
164
  },
161
165
  "devDependencies": {
162
166
  "@ampproject/remapping": "^2.2.1",
package/reporters.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/reporters.js'