vitest 0.5.7 → 0.6.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.
- package/LICENSE.md +0 -7
- package/dist/chunk-api-setup.8a83fa48.js +4443 -0
- package/dist/chunk-constants.a82c3238.js +32 -0
- package/dist/chunk-defaults.8d4c2fa4.js +148 -0
- package/dist/chunk-install-pkg.ba2381b8.js +1643 -0
- package/dist/chunk-integrations-globals.8b635704.js +24 -0
- package/dist/chunk-magic-string.d5e0e473.js +1408 -0
- package/dist/chunk-runtime-chain.d117aaa7.js +7035 -0
- package/dist/chunk-runtime-rpc.1832c38c.js +1 -1
- package/dist/chunk-utils-base.a107f2b1.js +409 -0
- package/dist/chunk-utils-source-map.bc814f37.js +4648 -0
- package/dist/chunk-vite-node-externalize.feaddbac.js +10966 -0
- package/dist/chunk-vite-node-utils.4a2f9073.js +9451 -0
- package/dist/cli.js +26 -19
- package/dist/config.d.ts +18 -2
- package/dist/entry.js +52 -1086
- package/dist/index.d.ts +12 -3
- package/dist/index.js +8 -6
- package/dist/jest-mock.js +1 -1
- package/dist/node.d.ts +18 -2
- package/dist/node.js +13 -14
- package/dist/{vendor-_commonjsHelpers.91d4f591.js → vendor-_commonjsHelpers.edc3a5f0.js} +2 -2
- package/dist/vendor-index.a89597d0.js +1109 -0
- package/dist/vendor-index.ee829ed6.js +5708 -0
- package/dist/worker.js +11 -7
- package/importMeta.d.ts +4 -0
- package/package.json +12 -9
- package/dist/chunk-api-setup.ab3a8330.js +0 -4444
- package/dist/chunk-constants.a1a50d89.js +0 -32
- package/dist/chunk-defaults.8ca84d7b.js +0 -1833
- package/dist/chunk-install-pkg.7ce2052a.js +0 -1643
- package/dist/chunk-integrations-globals.9bda85f1.js +0 -24
- package/dist/chunk-magic-string.6c8f4a10.js +0 -1361
- package/dist/chunk-runtime-chain.d86ab074.js +0 -5946
- package/dist/chunk-runtime-hooks.aef17670.js +0 -42
- package/dist/chunk-utils-base.39767f3e.js +0 -225
- package/dist/chunk-utils-source-map.be2b14e2.js +0 -3407
- package/dist/chunk-vite-node-externalize.7a4060a6.js +0 -10515
- package/dist/chunk-vite-node-utils.952694b8.js +0 -9451
- package/dist/vendor-index.665a6ba4.js +0 -5708
- package/dist/vendor-index.76be1f4d.js +0 -187
- package/dist/vendor-index.f6809970.js +0 -1111
package/dist/config.d.ts
CHANGED
|
@@ -130,7 +130,7 @@ interface ViteNodeServerOptions {
|
|
|
130
130
|
*/
|
|
131
131
|
deps?: DepsHandlingOptions;
|
|
132
132
|
/**
|
|
133
|
-
*
|
|
133
|
+
* Transform method for modules
|
|
134
134
|
*/
|
|
135
135
|
transformMode?: {
|
|
136
136
|
ssr?: RegExp[];
|
|
@@ -233,7 +233,9 @@ declare class Vitest {
|
|
|
233
233
|
exit(force?: boolean): Promise<void>;
|
|
234
234
|
report<T extends keyof Reporter>(name: T, ...args: ArgumentsType<Reporter[T]>): Promise<void>;
|
|
235
235
|
globTestFiles(filters?: string[]): Promise<string[]>;
|
|
236
|
-
isTargetFile(id: string): boolean
|
|
236
|
+
isTargetFile(id: string, source?: string): Promise<boolean>;
|
|
237
|
+
isInSourceTestFile(code: string): boolean;
|
|
238
|
+
printError(err: unknown): Promise<void>;
|
|
237
239
|
onServerRestarted(fn: () => void): void;
|
|
238
240
|
}
|
|
239
241
|
|
|
@@ -531,6 +533,7 @@ interface TaskResult {
|
|
|
531
533
|
state: TaskState;
|
|
532
534
|
duration?: number;
|
|
533
535
|
error?: ErrorWithDiff;
|
|
536
|
+
hooks?: Partial<Record<keyof SuiteHooks, TaskState>>;
|
|
534
537
|
}
|
|
535
538
|
declare type TaskResultPack = [id: string, result: TaskResult | undefined];
|
|
536
539
|
interface Suite extends TaskBase {
|
|
@@ -548,6 +551,13 @@ interface Test extends TaskBase {
|
|
|
548
551
|
fails?: boolean;
|
|
549
552
|
}
|
|
550
553
|
declare type Task = Test | Suite | File;
|
|
554
|
+
declare type HookListener<T extends any[]> = (...args: T) => Awaitable<void>;
|
|
555
|
+
interface SuiteHooks {
|
|
556
|
+
beforeAll: HookListener<[Suite]>[];
|
|
557
|
+
afterAll: HookListener<[Suite]>[];
|
|
558
|
+
beforeEach: HookListener<[Test, Suite]>[];
|
|
559
|
+
afterEach: HookListener<[Test, Suite]>[];
|
|
560
|
+
}
|
|
551
561
|
|
|
552
562
|
interface Reporter {
|
|
553
563
|
onInit?(ctx: Vitest): void;
|
|
@@ -618,6 +628,12 @@ interface InlineConfig {
|
|
|
618
628
|
* @default ['node_modules', 'dist', '.idea', '.git', '.cache']
|
|
619
629
|
*/
|
|
620
630
|
exclude?: string[];
|
|
631
|
+
/**
|
|
632
|
+
* Include globs for in-source test files
|
|
633
|
+
*
|
|
634
|
+
* @default []
|
|
635
|
+
*/
|
|
636
|
+
includeSource?: string[];
|
|
621
637
|
/**
|
|
622
638
|
* Handling for dependencies inlining or externalizing
|
|
623
639
|
*/
|