vitest 0.0.70 → 0.0.71
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/cli.js +8 -1416
- package/dist/entry.js +505 -81
- package/dist/error-fb6ff2e6.js +1415 -0
- package/dist/index.d.ts +108 -0
- package/global.d.ts +0 -1
- package/package.json +1 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Formatter } from 'picocolors/types';
|
|
1
2
|
import { TransformResult, ViteDevServer } from 'vite';
|
|
2
3
|
import { OptionsReceived } from 'pretty-format';
|
|
3
4
|
import { MessagePort } from 'worker_threads';
|
|
@@ -5,6 +6,110 @@ export { assert, default as chai, expect, should } from 'chai';
|
|
|
5
6
|
import sinon from 'sinon';
|
|
6
7
|
export { default as sinon } from 'sinon';
|
|
7
8
|
|
|
9
|
+
declare const EXPECTED_COLOR: Formatter;
|
|
10
|
+
declare const RECEIVED_COLOR: Formatter;
|
|
11
|
+
declare const INVERTED_COLOR: Formatter;
|
|
12
|
+
declare const BOLD_WEIGHT: Formatter;
|
|
13
|
+
declare const DIM_COLOR: Formatter;
|
|
14
|
+
declare type MatcherHintOptions = {
|
|
15
|
+
comment?: string;
|
|
16
|
+
expectedColor?: Formatter;
|
|
17
|
+
isDirectExpectCall?: boolean;
|
|
18
|
+
isNot?: boolean;
|
|
19
|
+
promise?: string;
|
|
20
|
+
receivedColor?: Formatter;
|
|
21
|
+
secondArgument?: string;
|
|
22
|
+
secondArgumentColor?: Formatter;
|
|
23
|
+
};
|
|
24
|
+
declare function matcherHint(matcherName: string, received?: string, expected?: string, options?: MatcherHintOptions): string;
|
|
25
|
+
declare const stringify: (object: unknown, maxDepth?: number) => string;
|
|
26
|
+
declare const printReceived: (object: unknown) => string;
|
|
27
|
+
declare const printExpected: (value: unknown) => string;
|
|
28
|
+
declare type DiffOptions = {
|
|
29
|
+
aAnnotation?: string;
|
|
30
|
+
aColor?: Formatter;
|
|
31
|
+
aIndicator?: string;
|
|
32
|
+
bAnnotation?: string;
|
|
33
|
+
bColor?: Formatter;
|
|
34
|
+
bIndicator?: string;
|
|
35
|
+
changeColor?: Formatter;
|
|
36
|
+
changeLineTrailingSpaceColor?: Formatter;
|
|
37
|
+
commonColor?: Formatter;
|
|
38
|
+
commonIndicator?: string;
|
|
39
|
+
commonLineTrailingSpaceColor?: Formatter;
|
|
40
|
+
contextLines?: number;
|
|
41
|
+
emptyFirstOrLastLinePlaceholder?: string;
|
|
42
|
+
expand?: boolean;
|
|
43
|
+
includeChangeCounts?: boolean;
|
|
44
|
+
omitAnnotationLines?: boolean;
|
|
45
|
+
patchColor?: Formatter;
|
|
46
|
+
compareKeys?: any;
|
|
47
|
+
};
|
|
48
|
+
declare function diff(a: any, b: any, options?: DiffOptions): string;
|
|
49
|
+
|
|
50
|
+
declare const jestMatcherUtils_EXPECTED_COLOR: typeof EXPECTED_COLOR;
|
|
51
|
+
declare const jestMatcherUtils_RECEIVED_COLOR: typeof RECEIVED_COLOR;
|
|
52
|
+
declare const jestMatcherUtils_INVERTED_COLOR: typeof INVERTED_COLOR;
|
|
53
|
+
declare const jestMatcherUtils_BOLD_WEIGHT: typeof BOLD_WEIGHT;
|
|
54
|
+
declare const jestMatcherUtils_DIM_COLOR: typeof DIM_COLOR;
|
|
55
|
+
type jestMatcherUtils_MatcherHintOptions = MatcherHintOptions;
|
|
56
|
+
declare const jestMatcherUtils_matcherHint: typeof matcherHint;
|
|
57
|
+
declare const jestMatcherUtils_stringify: typeof stringify;
|
|
58
|
+
declare const jestMatcherUtils_printReceived: typeof printReceived;
|
|
59
|
+
declare const jestMatcherUtils_printExpected: typeof printExpected;
|
|
60
|
+
type jestMatcherUtils_DiffOptions = DiffOptions;
|
|
61
|
+
declare const jestMatcherUtils_diff: typeof diff;
|
|
62
|
+
declare namespace jestMatcherUtils {
|
|
63
|
+
export {
|
|
64
|
+
jestMatcherUtils_EXPECTED_COLOR as EXPECTED_COLOR,
|
|
65
|
+
jestMatcherUtils_RECEIVED_COLOR as RECEIVED_COLOR,
|
|
66
|
+
jestMatcherUtils_INVERTED_COLOR as INVERTED_COLOR,
|
|
67
|
+
jestMatcherUtils_BOLD_WEIGHT as BOLD_WEIGHT,
|
|
68
|
+
jestMatcherUtils_DIM_COLOR as DIM_COLOR,
|
|
69
|
+
jestMatcherUtils_MatcherHintOptions as MatcherHintOptions,
|
|
70
|
+
jestMatcherUtils_matcherHint as matcherHint,
|
|
71
|
+
jestMatcherUtils_stringify as stringify,
|
|
72
|
+
jestMatcherUtils_printReceived as printReceived,
|
|
73
|
+
jestMatcherUtils_printExpected as printExpected,
|
|
74
|
+
jestMatcherUtils_DiffOptions as DiffOptions,
|
|
75
|
+
jestMatcherUtils_diff as diff,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
declare type Tester = (a: any, b: any) => boolean | undefined;
|
|
80
|
+
declare type MatcherState = {
|
|
81
|
+
assertionCalls: number;
|
|
82
|
+
currentTestName?: string;
|
|
83
|
+
dontThrow?: () => void;
|
|
84
|
+
error?: Error;
|
|
85
|
+
equals: (a: unknown, b: unknown, customTesters?: Array<Tester>, strictCheck?: boolean) => boolean;
|
|
86
|
+
expand?: boolean;
|
|
87
|
+
expectedAssertionsNumber?: number | null;
|
|
88
|
+
expectedAssertionsNumberError?: Error;
|
|
89
|
+
isExpectingAssertions?: boolean;
|
|
90
|
+
isExpectingAssertionsError?: Error;
|
|
91
|
+
isNot: boolean;
|
|
92
|
+
promise: string;
|
|
93
|
+
suppressedErrors: Array<Error>;
|
|
94
|
+
testPath?: string;
|
|
95
|
+
utils: typeof jestMatcherUtils & {
|
|
96
|
+
iterableEquality: Tester;
|
|
97
|
+
subsetEquality: Tester;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
declare type SyncExpectationResult = {
|
|
101
|
+
pass: boolean;
|
|
102
|
+
message: () => string;
|
|
103
|
+
};
|
|
104
|
+
declare type AsyncExpectationResult = Promise<SyncExpectationResult>;
|
|
105
|
+
declare type ExpectationResult = SyncExpectationResult | AsyncExpectationResult;
|
|
106
|
+
declare type RawMatcherFn<T extends MatcherState = MatcherState> = {
|
|
107
|
+
(this: T, received: any, expected: any, options?: any): ExpectationResult;
|
|
108
|
+
};
|
|
109
|
+
declare type MatchersObject<T extends MatcherState = MatcherState> = {
|
|
110
|
+
[id: string]: RawMatcherFn<T>;
|
|
111
|
+
};
|
|
112
|
+
|
|
8
113
|
declare class StateManager {
|
|
9
114
|
filesMap: Record<string, File>;
|
|
10
115
|
idMap: Record<string, Task>;
|
|
@@ -441,6 +546,9 @@ declare module 'vite' {
|
|
|
441
546
|
}
|
|
442
547
|
declare global {
|
|
443
548
|
namespace Chai {
|
|
549
|
+
interface ExpectStatic {
|
|
550
|
+
extend(expects: MatchersObject): void;
|
|
551
|
+
}
|
|
444
552
|
interface Assertion {
|
|
445
553
|
toMatchSnapshot(message?: string): Assertion;
|
|
446
554
|
matchSnapshot(message?: string): Assertion;
|
package/global.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ declare global {
|
|
|
3
3
|
const test: typeof import('vitest')['test']
|
|
4
4
|
const describe: typeof import('vitest')['describe']
|
|
5
5
|
const it: typeof import('vitest')['it']
|
|
6
|
-
const chai: typeof import('vitest')['chai']
|
|
7
6
|
const expect: typeof import('vitest')['expect']
|
|
8
7
|
const assert: typeof import('vitest')['assert']
|
|
9
8
|
const sinon: typeof import('vitest')['sinon']
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.71",
|
|
4
4
|
"description": "A blazing fast unit test framework powered by Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
"docs:build": "npm -C docs run build",
|
|
47
47
|
"docs:serve": "npm -C docs run serve",
|
|
48
48
|
"lint": "eslint \"{src,test}/**/*.ts\"",
|
|
49
|
-
"prepare": "esmo scripts/generate-types.ts",
|
|
50
49
|
"prepublishOnly": "nr build",
|
|
51
50
|
"release": "bumpp --commit --push --tag && esmo scripts/publish.ts",
|
|
52
51
|
"test": "node bin/vitest.mjs -r test/core",
|