vitest 0.1.18 → 0.1.19

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
@@ -241,13 +241,35 @@ interface RawSourceMap extends StartOfSourceMap {
241
241
  mappings: string;
242
242
  }
243
243
 
244
- interface ExternalizeOptions {
244
+ interface DepsHandlingOptions {
245
245
  external?: (string | RegExp)[];
246
246
  inline?: (string | RegExp)[];
247
+ /**
248
+ * Try to guess the CJS version of a package when it's invalid ESM
249
+ * @default true
250
+ */
247
251
  fallbackCJS?: boolean;
248
252
  }
253
+ interface ViteNodeResolveId$1 {
254
+ external?: boolean | 'absolute' | 'relative';
255
+ id: string;
256
+ meta?: Record<string, any> | null;
257
+ moduleSideEffects?: boolean | 'no-treeshake' | null;
258
+ syntheticNamedExports?: boolean | string | null;
259
+ }
249
260
  interface ViteNodeServerOptions {
250
- deps?: ExternalizeOptions;
261
+ /**
262
+ * Inject inline sourcemap to modules
263
+ * @default true
264
+ */
265
+ sourcemap?: boolean;
266
+ /**
267
+ * Deps handling
268
+ */
269
+ deps?: DepsHandlingOptions;
270
+ /**
271
+ * Tranform method for modules
272
+ */
251
273
  transformMode?: {
252
274
  ssr?: RegExp[];
253
275
  web?: RegExp[];
@@ -267,6 +289,7 @@ declare class ViteNodeServer {
267
289
  code: string | undefined;
268
290
  externalize?: undefined;
269
291
  }>;
292
+ resolveId(id: string, importer?: string): Promise<ViteNodeResolveId$1 | null>;
270
293
  transformRequest(id: string): Promise<TransformResult | null | undefined>;
271
294
  private getTransformMode;
272
295
  private _transformRequest;
@@ -1027,6 +1050,14 @@ interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters'
1027
1050
  api?: ApiConfig;
1028
1051
  }
1029
1052
 
1053
+ interface ViteNodeResolveId {
1054
+ external?: boolean | 'absolute' | 'relative';
1055
+ id: string;
1056
+ meta?: Record<string, any> | null;
1057
+ moduleSideEffects?: boolean | 'no-treeshake' | null;
1058
+ syntheticNamedExports?: boolean | string | null;
1059
+ }
1060
+
1030
1061
  interface WorkerContext {
1031
1062
  port: MessagePort;
1032
1063
  config: ResolvedConfig;
@@ -1037,8 +1068,10 @@ declare type FetchFunction = (id: string) => Promise<{
1037
1068
  code?: string;
1038
1069
  externalize?: string;
1039
1070
  }>;
1071
+ declare type ResolveIdFunction = (id: string, importer?: string) => Promise<ViteNodeResolveId | null>;
1040
1072
  interface WorkerRPC {
1041
1073
  fetch: FetchFunction;
1074
+ resolveId: ResolveIdFunction;
1042
1075
  getSourceMap: (id: string, force?: boolean) => Promise<RawSourceMap | undefined>;
1043
1076
  onWorkerExit: (code?: number) => void;
1044
1077
  onUserConsoleLog: (log: UserConsoleLog) => void;
@@ -1339,4 +1372,4 @@ declare global {
1339
1372
  }
1340
1373
  }
1341
1374
 
1342
- export { ApiConfig, ArgumentsType, Arrayable, Awaitable, BuiltinEnvironment, Constructable, DoneCallback, EnhancedSpy, Environment, EnvironmentOptions, EnvironmentReturn, ErrorWithDiff, FetchFunction, File, HookListener, InlineConfig, JSDOMOptions, JestMockCompat, JestMockCompatContext, JestMockCompatFn, MaybeMocked, MaybeMockedConstructor, MaybeMockedDeep, MockWithArgs, MockedFunction, MockedFunctionDeep, MockedObject, MockedObjectDeep, ModuleCache, ModuleGraphData, Nullable, ParsedStack, Position, Reporter, ResolvedConfig, RunMode, RuntimeContext, SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, Suite, SuiteCollector, SuiteHooks, Task, TaskBase, TaskResult, TaskResultPack, TaskState, Test, TestCollector, TestFactory, TestFunction, TransformResultWithSource, UncheckedSnapshot, UserConfig, UserConsoleLog, WebSocketEvents, WebSocketHandlers, WorkerContext, WorkerRPC, afterAll, afterEach, beforeAll, beforeEach, describe, expect, fn, isMockFunction, it, spies, spyOn, suite, test, vi, vitest };
1375
+ export { ApiConfig, ArgumentsType, Arrayable, Awaitable, BuiltinEnvironment, Constructable, DoneCallback, EnhancedSpy, Environment, EnvironmentOptions, EnvironmentReturn, ErrorWithDiff, FetchFunction, File, HookListener, InlineConfig, JSDOMOptions, JestMockCompat, JestMockCompatContext, JestMockCompatFn, MaybeMocked, MaybeMockedConstructor, MaybeMockedDeep, MockWithArgs, MockedFunction, MockedFunctionDeep, MockedObject, MockedObjectDeep, ModuleCache, ModuleGraphData, Nullable, ParsedStack, Position, Reporter, ResolveIdFunction, ResolvedConfig, RunMode, RuntimeContext, SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, Suite, SuiteCollector, SuiteHooks, Task, TaskBase, TaskResult, TaskResultPack, TaskState, Test, TestCollector, TestFactory, TestFunction, TransformResultWithSource, UncheckedSnapshot, UserConfig, UserConsoleLog, WebSocketEvents, WebSocketHandlers, WorkerContext, WorkerRPC, afterAll, afterEach, beforeAll, beforeEach, describe, expect, fn, isMockFunction, it, spies, spyOn, suite, test, vi, vitest };
package/dist/node.d.ts CHANGED
@@ -13,13 +13,35 @@ interface RawSourceMap extends StartOfSourceMap {
13
13
  mappings: string;
14
14
  }
15
15
 
16
- interface ExternalizeOptions {
16
+ interface DepsHandlingOptions {
17
17
  external?: (string | RegExp)[];
18
18
  inline?: (string | RegExp)[];
19
+ /**
20
+ * Try to guess the CJS version of a package when it's invalid ESM
21
+ * @default true
22
+ */
19
23
  fallbackCJS?: boolean;
20
24
  }
25
+ interface ViteNodeResolveId {
26
+ external?: boolean | 'absolute' | 'relative';
27
+ id: string;
28
+ meta?: Record<string, any> | null;
29
+ moduleSideEffects?: boolean | 'no-treeshake' | null;
30
+ syntheticNamedExports?: boolean | string | null;
31
+ }
21
32
  interface ViteNodeServerOptions {
22
- deps?: ExternalizeOptions;
33
+ /**
34
+ * Inject inline sourcemap to modules
35
+ * @default true
36
+ */
37
+ sourcemap?: boolean;
38
+ /**
39
+ * Deps handling
40
+ */
41
+ deps?: DepsHandlingOptions;
42
+ /**
43
+ * Tranform method for modules
44
+ */
23
45
  transformMode?: {
24
46
  ssr?: RegExp[];
25
47
  web?: RegExp[];
@@ -39,6 +61,7 @@ declare class ViteNodeServer {
39
61
  code: string | undefined;
40
62
  externalize?: undefined;
41
63
  }>;
64
+ resolveId(id: string, importer?: string): Promise<ViteNodeResolveId | null>;
42
65
  transformRequest(id: string): Promise<TransformResult | null | undefined>;
43
66
  private getTransformMode;
44
67
  private _transformRequest;
package/dist/node.js CHANGED
@@ -1,4 +1,4 @@
1
- export { V as VitestPlugin, c as createVitest } from './create-9b6f7e20.js';
1
+ export { V as VitestPlugin, c as createVitest } from './create-21435b9d.js';
2
2
  import './index-1964368a.js';
3
3
  import 'path';
4
4
  import 'vite';
@@ -13,7 +13,7 @@ import 'events';
13
13
  import './index-f2daefb8.js';
14
14
  import 'tty';
15
15
  import 'local-pkg';
16
- import './index-46e1d4ad.js';
16
+ import './index-058a289b.js';
17
17
  import 'module';
18
18
  import 'assert';
19
19
  import 'perf_hooks';