vitest 0.18.0 → 0.19.1

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 (36) hide show
  1. package/LICENSE.md +6 -6
  2. package/dist/browser.d.ts +1850 -0
  3. package/dist/browser.mjs +20 -0
  4. package/dist/{chunk-api-setup.63babd7c.mjs → chunk-api-setup.0cf2c96a.mjs} +37 -11
  5. package/dist/{chunk-constants.8eb2ed35.mjs → chunk-constants.38b43a44.mjs} +3 -3
  6. package/dist/{chunk-env-node.26c72624.mjs → chunk-defaults.ed196a9a.mjs} +458 -455
  7. package/dist/{chunk-install-pkg.2dcb2c04.mjs → chunk-install-pkg.6c6dc0c2.mjs} +11 -10
  8. package/dist/chunk-integrations-globals.1018e651.mjs +24 -0
  9. package/dist/chunk-node-git.9058b82a.mjs +1139 -0
  10. package/dist/chunk-runtime-chain.f2e00f4c.mjs +2039 -0
  11. package/dist/{vendor-entry.78de67ab.mjs → chunk-runtime-error.606e0393.mjs} +167 -183
  12. package/dist/{chunk-runtime-chain.eb764dff.mjs → chunk-runtime-hooks.d4cadf47.mjs} +33 -2012
  13. package/dist/{chunk-runtime-mocker.79ccc3de.mjs → chunk-runtime-mocker.dfdfd57b.mjs} +70 -22
  14. package/dist/{chunk-runtime-rpc.cc6a06a2.mjs → chunk-runtime-rpc.45d8ee19.mjs} +1 -1
  15. package/dist/{chunk-utils-global.1b22c4fd.mjs → chunk-utils-global.2aa95025.mjs} +11 -6
  16. package/dist/{chunk-utils-source-map.957e7756.mjs → chunk-utils-source-map.8b066ce2.mjs} +2 -2
  17. package/dist/{chunk-vite-node-externalize.0791f2ed.mjs → chunk-vite-node-externalize.e9af6472.mjs} +105 -1174
  18. package/dist/chunk-vite-node-utils.ad73f2ab.mjs +1433 -0
  19. package/dist/cli.mjs +9 -11
  20. package/dist/config.cjs +4 -1
  21. package/dist/config.d.ts +1 -0
  22. package/dist/config.mjs +4 -1
  23. package/dist/entry.mjs +54 -10
  24. package/dist/index.d.ts +56 -27
  25. package/dist/index.mjs +12 -9
  26. package/dist/node.d.ts +37 -18
  27. package/dist/node.mjs +10 -12
  28. package/dist/spy.mjs +102 -2
  29. package/dist/suite.mjs +13 -0
  30. package/dist/vendor-index.61438b77.mjs +335 -0
  31. package/dist/{vendor-index.4bf9c627.mjs → vendor-index.62ce5c33.mjs} +11 -343
  32. package/dist/worker.mjs +6 -6
  33. package/package.json +20 -12
  34. package/dist/chunk-integrations-globals.61e4d6ae.mjs +0 -26
  35. package/dist/chunk-integrations-spy.674b628e.mjs +0 -102
  36. package/dist/chunk-vite-node-utils.af8ead96.mjs +0 -9195
@@ -0,0 +1,20 @@
1
+ export { c as createExpect, d as describe, b as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.f2e00f4c.mjs';
2
+ export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach } from './chunk-runtime-hooks.d4cadf47.mjs';
3
+ export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-error.606e0393.mjs';
4
+ import * as chai from 'chai';
5
+ export { chai };
6
+ export { assert, should } from 'chai';
7
+ import 'util';
8
+ import './chunk-utils-global.2aa95025.mjs';
9
+ import 'path';
10
+ import 'tty';
11
+ import 'local-pkg';
12
+ import './vendor-_commonjsHelpers.4da45ef5.mjs';
13
+ import './chunk-runtime-rpc.45d8ee19.mjs';
14
+ import 'fs';
15
+ import './chunk-utils-source-map.8b066ce2.mjs';
16
+ import './spy.mjs';
17
+ import 'tinyspy';
18
+ import './chunk-defaults.ed196a9a.mjs';
19
+ import 'module';
20
+ import 'url';
@@ -1,5 +1,5 @@
1
1
  import { promises } from 'fs';
2
- import { c as createBirpc } from './chunk-vite-node-utils.af8ead96.mjs';
2
+ import { c as createBirpc } from './chunk-vite-node-utils.ad73f2ab.mjs';
3
3
  import require$$0$1 from 'stream';
4
4
  import require$$0 from 'zlib';
5
5
  import require$$3 from 'net';
@@ -8,15 +8,15 @@ import require$$5 from 'crypto';
8
8
  import require$$2 from 'events';
9
9
  import require$$1 from 'https';
10
10
  import require$$2$1 from 'http';
11
- import url from 'url';
12
- import { A as API_PATH } from './chunk-constants.8eb2ed35.mjs';
13
- import { j as interpretSourcePos, b as parseStacktrace } from './chunk-utils-source-map.957e7756.mjs';
11
+ import _url from 'url';
12
+ import { A as API_PATH } from './chunk-constants.38b43a44.mjs';
13
+ import { j as interpretSourcePos, p as parseStacktrace } from './chunk-utils-source-map.8b066ce2.mjs';
14
14
  import 'module';
15
15
  import 'vm';
16
- import './chunk-utils-global.1b22c4fd.mjs';
16
+ import './chunk-utils-global.2aa95025.mjs';
17
+ import 'path';
17
18
  import 'tty';
18
19
  import 'local-pkg';
19
- import 'path';
20
20
  import 'assert';
21
21
  import 'util';
22
22
  import 'debug';
@@ -2513,7 +2513,7 @@ const http$1 = require$$2$1;
2513
2513
  const net = require$$3;
2514
2514
  const tls = require$$4;
2515
2515
  const { randomBytes, createHash: createHash$1 } = require$$5;
2516
- const { URL: URL$1 } = url;
2516
+ const { URL: URL$1 } = _url;
2517
2517
 
2518
2518
  const PerMessageDeflate$1 = permessageDeflate;
2519
2519
  const Receiver = receiver;
@@ -3217,11 +3217,11 @@ function initAsClient(websocket, address, protocols, options) {
3217
3217
  ? parsedUrl.hostname.slice(1, -1)
3218
3218
  : parsedUrl.hostname;
3219
3219
  opts.headers = {
3220
+ ...opts.headers,
3220
3221
  'Sec-WebSocket-Version': opts.protocolVersion,
3221
3222
  'Sec-WebSocket-Key': key,
3222
3223
  Connection: 'Upgrade',
3223
- Upgrade: 'websocket',
3224
- ...opts.headers
3224
+ Upgrade: 'websocket'
3225
3225
  };
3226
3226
  opts.path = parsedUrl.pathname + parsedUrl.search;
3227
3227
  opts.timeout = opts.handshakeTimeout;
@@ -3275,8 +3275,11 @@ function initAsClient(websocket, address, protocols, options) {
3275
3275
 
3276
3276
  if (opts.followRedirects) {
3277
3277
  if (websocket._redirects === 0) {
3278
+ websocket._originalUnixSocket = isUnixSocket;
3278
3279
  websocket._originalSecure = isSecure;
3279
- websocket._originalHost = parsedUrl.host;
3280
+ websocket._originalHostOrSocketPath = isUnixSocket
3281
+ ? opts.socketPath
3282
+ : parsedUrl.host;
3280
3283
 
3281
3284
  const headers = options && options.headers;
3282
3285
 
@@ -3292,7 +3295,13 @@ function initAsClient(websocket, address, protocols, options) {
3292
3295
  }
3293
3296
  }
3294
3297
  } else if (websocket.listenerCount('redirect') === 0) {
3295
- const isSameHost = parsedUrl.host === websocket._originalHost;
3298
+ const isSameHost = isUnixSocket
3299
+ ? websocket._originalUnixSocket
3300
+ ? opts.socketPath === websocket._originalHostOrSocketPath
3301
+ : false
3302
+ : websocket._originalUnixSocket
3303
+ ? false
3304
+ : parsedUrl.host === websocket._originalHostOrSocketPath;
3296
3305
 
3297
3306
  if (!isSameHost || (websocket._originalSecure && !isSecure)) {
3298
3307
  //
@@ -4408,9 +4417,26 @@ function setup(ctx) {
4408
4417
  });
4409
4418
  function setupClient(ws) {
4410
4419
  const rpc = createBirpc({
4420
+ async onWatcherStart() {
4421
+ await ctx.report("onWatcherStart");
4422
+ },
4423
+ async onFinished() {
4424
+ await ctx.report("onFinished");
4425
+ },
4426
+ async onCollected(files) {
4427
+ ctx.state.collectFiles(files);
4428
+ await ctx.report("onCollected", files);
4429
+ },
4430
+ async onTaskUpdate(packs) {
4431
+ ctx.state.updateTasks(packs);
4432
+ await ctx.report("onTaskUpdate", packs);
4433
+ },
4411
4434
  getFiles() {
4412
4435
  return ctx.state.getFiles();
4413
4436
  },
4437
+ getPaths() {
4438
+ return ctx.state.getPaths();
4439
+ },
4414
4440
  readFile(id) {
4415
4441
  return promises.readFile(id, "utf-8");
4416
4442
  },
@@ -1,7 +1,7 @@
1
- import { fileURLToPath } from 'url';
2
- import { q as resolve } from './chunk-utils-global.1b22c4fd.mjs';
1
+ import _url from 'url';
2
+ import { C as resolve } from './chunk-utils-global.2aa95025.mjs';
3
3
 
4
- const distDir = resolve(fileURLToPath(import.meta.url), "../../dist");
4
+ const distDir = resolve(_url.fileURLToPath(import.meta.url), "../../dist");
5
5
  const defaultPort = 51204;
6
6
  const API_PATH = "/__vitest_api__";
7
7
  const configFiles = [