vitest 0.0.128 → 0.0.129

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.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { OptionsReceived, Plugin } from 'pretty-format';
2
2
  import { Formatter } from 'picocolors/types';
3
- import { ViteDevServer } from 'vite';
3
+ import { ViteDevServer, CommonServerOptions } from 'vite';
4
4
  import { RawSourceMap } from 'source-map-js';
5
5
  import { MessagePort } from 'worker_threads';
6
6
  import { SpyImpl } from 'tinyspy';
@@ -511,6 +511,7 @@ interface SnapshotSummary {
511
511
  }
512
512
 
513
513
  declare type BuiltinEnvironment = 'node' | 'jsdom' | 'happy-dom';
514
+ declare type ApiConfig = Pick<CommonServerOptions, 'port' | 'strictPort' | 'host'>;
514
515
  interface InlineConfig {
515
516
  /**
516
517
  * Include globs for test files
@@ -647,24 +648,10 @@ interface InlineConfig {
647
648
  * Coverage options
648
649
  */
649
650
  coverage?: C8Options;
650
- /**
651
- * Open Vitest UI
652
- * @internal WIP
653
- */
654
- open?: boolean;
655
651
  /**
656
652
  * run test names with the specified pattern
657
653
  */
658
654
  testNamePattern?: string | RegExp;
659
- /**
660
- * Listen to port and serve API
661
- *
662
- * When set to true, the default port is 55555
663
- *
664
- * @internal WIP
665
- * @default false
666
- */
667
- api?: boolean | number;
668
655
  /**
669
656
  * Will call `.mockClear()` on all spies before each test
670
657
  * @default false
@@ -680,6 +667,19 @@ interface InlineConfig {
680
667
  * @default false
681
668
  */
682
669
  restoreMocks?: boolean;
670
+ /**
671
+ * Serve API options.
672
+ *
673
+ * When set to true, the default port is 51204.
674
+ *
675
+ * @default false
676
+ */
677
+ api?: boolean | number | ApiConfig;
678
+ /**
679
+ * Open Vitest UI
680
+ * @internal WIP
681
+ */
682
+ open?: boolean;
683
683
  }
684
684
  interface UserConfig extends InlineConfig {
685
685
  /**
@@ -709,7 +709,7 @@ interface UserConfig extends InlineConfig {
709
709
  */
710
710
  related?: string[] | string;
711
711
  }
712
- interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters' | 'coverage' | 'testNamePattern' | 'related'> {
712
+ interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters' | 'coverage' | 'testNamePattern' | 'related' | 'api'> {
713
713
  config?: string;
714
714
  filters?: string[];
715
715
  testNamePattern?: RegExp;
@@ -720,6 +720,7 @@ interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters'
720
720
  interpretDefault: boolean;
721
721
  coverage: ResolvedC8Options;
722
722
  snapshotOptions: SnapshotStateOptions;
723
+ api?: ApiConfig;
723
724
  }
724
725
 
725
726
  interface WorkerContext {
@@ -1012,4 +1013,4 @@ declare global {
1012
1013
  }
1013
1014
  }
1014
1015
 
1015
- export { ArgumentsOf, ArgumentsType, Arrayable, Awaitable, BuiltinEnvironment, ConstructorArgumentsOf, DoneCallback, EnhancedSpy, Environment, EnvironmentReturn, ErrorWithDiff, File, HookListener, InlineConfig, JestMockCompat, JestMockCompatContext, JestMockCompatFn, MaybeMocked, MaybeMockedConstructor, MaybeMockedDeep, MethodKeysOf, MockWithArgs, MockableFunction, MockedFunction, MockedFunctionDeep, MockedObject, MockedObjectDeep, ModuleCache, Nullable, ParsedStack, Position, PropertyKeysOf, Reporter, ResolvedConfig, RunMode, RuntimeContext, SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, Suite, SuiteCollector, SuiteHooks, Task, TaskBase, TaskResult, TaskResultPack, TaskState, Test, TestCollector, TestFactory, TestFunction, UncheckedSnapshot, UserConfig, UserConsoleLog, WebSocketEvents, WebSocketHandlers, WorkerContext, WorkerRPC, afterAll, afterEach, beforeAll, beforeEach, describe, expect, fn, isMockFunction, it, spies, spyOn, suite, test, vi, vitest };
1016
+ export { ApiConfig, ArgumentsOf, ArgumentsType, Arrayable, Awaitable, BuiltinEnvironment, ConstructorArgumentsOf, DoneCallback, EnhancedSpy, Environment, EnvironmentReturn, ErrorWithDiff, File, HookListener, InlineConfig, JestMockCompat, JestMockCompatContext, JestMockCompatFn, MaybeMocked, MaybeMockedConstructor, MaybeMockedDeep, MethodKeysOf, MockWithArgs, MockableFunction, MockedFunction, MockedFunctionDeep, MockedObject, MockedObjectDeep, ModuleCache, Nullable, ParsedStack, Position, PropertyKeysOf, Reporter, ResolvedConfig, RunMode, RuntimeContext, SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, Suite, SuiteCollector, SuiteHooks, Task, TaskBase, TaskResult, TaskResultPack, TaskState, Test, TestCollector, TestFactory, TestFunction, UncheckedSnapshot, UserConfig, UserConsoleLog, WebSocketEvents, WebSocketHandlers, WorkerContext, WorkerRPC, afterAll, afterEach, beforeAll, beforeEach, describe, expect, fn, isMockFunction, it, spies, spyOn, suite, test, vi, vitest };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- export { d as describe, i as it, c as suite, t as test, e as vi, v as vitest } from './vi-02a9c349.js';
2
- export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, e as expect } from './index-de2249ec.js';
1
+ export { d as describe, i as it, c as suite, t as test, e as vi, v as vitest } from './vi-fe26a646.js';
2
+ export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, e as expect } from './index-06712022.js';
3
3
  export { f as fn, i as isMockFunction, s as spies, a as spyOn } from './jest-mock-30625866.js';
4
4
  export { assert, default as chai, should } from 'chai';
5
- import './index-f0488a5d.js';
5
+ import './index-42a3a132.js';
6
6
  import 'url';
7
7
  import 'tty';
8
8
  import 'local-pkg';
package/dist/node.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ViteDevServer, UserConfig as UserConfig$1 } from 'vite';
1
+ import { CommonServerOptions, ViteDevServer, UserConfig as UserConfig$1 } from 'vite';
2
2
  import { RawSourceMap } from 'source-map-js';
3
3
  import { OptionsReceived } from 'pretty-format';
4
4
 
@@ -227,6 +227,7 @@ interface SnapshotSummary {
227
227
  }
228
228
 
229
229
  declare type BuiltinEnvironment = 'node' | 'jsdom' | 'happy-dom';
230
+ declare type ApiConfig = Pick<CommonServerOptions, 'port' | 'strictPort' | 'host'>;
230
231
  interface InlineConfig {
231
232
  /**
232
233
  * Include globs for test files
@@ -363,24 +364,10 @@ interface InlineConfig {
363
364
  * Coverage options
364
365
  */
365
366
  coverage?: C8Options;
366
- /**
367
- * Open Vitest UI
368
- * @internal WIP
369
- */
370
- open?: boolean;
371
367
  /**
372
368
  * run test names with the specified pattern
373
369
  */
374
370
  testNamePattern?: string | RegExp;
375
- /**
376
- * Listen to port and serve API
377
- *
378
- * When set to true, the default port is 55555
379
- *
380
- * @internal WIP
381
- * @default false
382
- */
383
- api?: boolean | number;
384
371
  /**
385
372
  * Will call `.mockClear()` on all spies before each test
386
373
  * @default false
@@ -396,6 +383,19 @@ interface InlineConfig {
396
383
  * @default false
397
384
  */
398
385
  restoreMocks?: boolean;
386
+ /**
387
+ * Serve API options.
388
+ *
389
+ * When set to true, the default port is 51204.
390
+ *
391
+ * @default false
392
+ */
393
+ api?: boolean | number | ApiConfig;
394
+ /**
395
+ * Open Vitest UI
396
+ * @internal WIP
397
+ */
398
+ open?: boolean;
399
399
  }
400
400
  interface UserConfig extends InlineConfig {
401
401
  /**
@@ -425,7 +425,7 @@ interface UserConfig extends InlineConfig {
425
425
  */
426
426
  related?: string[] | string;
427
427
  }
428
- interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters' | 'coverage' | 'testNamePattern' | 'related'> {
428
+ interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters' | 'coverage' | 'testNamePattern' | 'related' | 'api'> {
429
429
  config?: string;
430
430
  filters?: string[];
431
431
  testNamePattern?: RegExp;
@@ -436,6 +436,7 @@ interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters'
436
436
  interpretDefault: boolean;
437
437
  coverage: ResolvedC8Options;
438
438
  snapshotOptions: SnapshotStateOptions;
439
+ api?: ApiConfig;
439
440
  }
440
441
 
441
442
  declare class SnapshotManager {
package/dist/node.js CHANGED
@@ -1,6 +1,6 @@
1
- export { c as createVitest } from './index-05648ba5.js';
1
+ export { c as createVitest } from './index-d30b5ed0.js';
2
2
  import 'fs';
3
- import './index-f0488a5d.js';
3
+ import './index-42a3a132.js';
4
4
  import 'url';
5
5
  import 'tty';
6
6
  import 'local-pkg';
@@ -11,14 +11,14 @@ import 'os';
11
11
  import 'util';
12
12
  import 'stream';
13
13
  import 'events';
14
- import './constants-2cd49e0a.js';
15
- import './magic-string.es-94000aea.js';
16
- import 'perf_hooks';
17
- import './diff-711cddf1.js';
18
- import './index-7975be53.js';
19
14
  import './_commonjsHelpers-c9e3b764.js';
15
+ import './constants-868b9a2e.js';
16
+ import './magic-string.es-98a8bfa0.js';
17
+ import 'perf_hooks';
18
+ import './diff-be830986.js';
19
+ import './index-cb02ee01.js';
20
20
  import 'assert';
21
21
  import 'module';
22
22
  import 'worker_threads';
23
23
  import 'tinypool';
24
- import './index-e909c175.js';
24
+ import './index-a73f33e0.js';
@@ -1,5 +1,5 @@
1
1
  import { promises } from 'fs';
2
- import { c as createBirpc } from './index-e909c175.js';
2
+ import { c as createBirpc } from './index-a73f33e0.js';
3
3
  import require$$0$1 from 'stream';
4
4
  import require$$0 from 'zlib';
5
5
  import require$$3 from 'net';
@@ -9,10 +9,10 @@ import require$$2 from 'events';
9
9
  import require$$1 from 'https';
10
10
  import require$$2$1 from 'http';
11
11
  import require$$7 from 'url';
12
- import { A as API_PATH } from './constants-2cd49e0a.js';
12
+ import { A as API_PATH } from './constants-868b9a2e.js';
13
13
  import { s as shouldExternalize } from './externalize-2f63779d.js';
14
- import { o as interpretSourcePos, n as parseStacktrace } from './diff-711cddf1.js';
15
- import './index-f0488a5d.js';
14
+ import { o as interpretSourcePos, n as parseStacktrace } from './diff-be830986.js';
15
+ import './index-42a3a132.js';
16
16
  import 'tty';
17
17
  import 'local-pkg';
18
18
  import 'path';
@@ -1,4 +1,4 @@
1
- import { n as noop, i as isObject } from './index-f0488a5d.js';
1
+ import { n as noop, i as isObject } from './index-42a3a132.js';
2
2
  import { i as isMockFunction, a as spyOn, f as fn, s as spies } from './jest-mock-30625866.js';
3
3
  import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-c9e3b764.js';
4
4
 
package/dist/worker.js CHANGED
@@ -1,6 +1,6 @@
1
- import { d as dirname, b as basename, k as resolve, p as mergeSlashes, q as join, s as slash, m as toFilePath } from './index-f0488a5d.js';
2
- import { c as createBirpc } from './index-e909c175.js';
3
- import { c as distDir } from './constants-2cd49e0a.js';
1
+ import { d as dirname, b as basename, k as resolve, p as mergeSlashes, q as join, s as slash, m as toFilePath } from './index-42a3a132.js';
2
+ import { c as createBirpc } from './index-a73f33e0.js';
3
+ import { c as distDir } from './constants-868b9a2e.js';
4
4
  import { builtinModules, createRequire } from 'module';
5
5
  import { pathToFileURL, fileURLToPath } from 'url';
6
6
  import vm from 'vm';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest",
3
- "version": "0.0.128",
3
+ "version": "0.0.129",
4
4
  "description": "A blazing fast unit test framework powered by Vite",
5
5
  "keywords": [
6
6
  "vite",
@@ -91,7 +91,7 @@
91
91
  "strip-ansi": "^7.0.1",
92
92
  "typescript": "^4.5.4",
93
93
  "ws": "^8.4.0",
94
- "@vitest/ui": "0.0.128"
94
+ "@vitest/ui": "0.0.129"
95
95
  },
96
96
  "peerDependencies": {
97
97
  "c8": "*",