tstyche 3.0.0-beta.2 → 3.0.0-beta.4
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/README.md +2 -2
- package/build/index.cjs +2 -0
- package/build/index.d.cts +19 -49
- package/build/index.d.ts +19 -49
- package/build/index.js +1 -1
- package/build/tstyche.d.ts +312 -261
- package/build/tstyche.js +3272 -3195
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ test("handles numbers", () => {
|
|
|
56
56
|
|
|
57
57
|
Here is the list of all matchers:
|
|
58
58
|
|
|
59
|
-
- `.toBe()`, `.toBeAssignableTo()`, `.toBeAssignableWith()
|
|
59
|
+
- `.toBe()`, `.toBeAssignableTo()`, `.toBeAssignableWith()` compare types or types of expression,
|
|
60
60
|
- `.toAcceptProps()` checks types of JSX component's props,
|
|
61
61
|
- `.toHaveProperty()` looks up keys on an object type,
|
|
62
62
|
- `.toRaiseError()` captures the type error message or code,
|
|
@@ -70,7 +70,7 @@ The `tstyche` command is the heart of TSTyche. For example, it can select test f
|
|
|
70
70
|
tstyche JsonObject --only external --target 4.8,latest
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
This simple! (And it has
|
|
73
|
+
This simple! (And it has watch mode too.)
|
|
74
74
|
|
|
75
75
|
## Documentation
|
|
76
76
|
|
package/build/index.cjs
CHANGED
package/build/index.d.cts
CHANGED
|
@@ -97,28 +97,6 @@ interface Matchers {
|
|
|
97
97
|
*/
|
|
98
98
|
(target: unknown): void;
|
|
99
99
|
};
|
|
100
|
-
/**
|
|
101
|
-
* Checks if the source type is assignable with the target type.
|
|
102
|
-
*
|
|
103
|
-
* @deprecated Use `.toBeAssignableWith()` or `.toBeAssignableTo()` instead. This matcher will be removed in TSTyche 3.
|
|
104
|
-
* To learn more, visit https://tstyche.org/release-notes/tstyche-2.
|
|
105
|
-
*/
|
|
106
|
-
toBeAssignable: {
|
|
107
|
-
/**
|
|
108
|
-
* Checks if the source type is assignable with the target type.
|
|
109
|
-
*
|
|
110
|
-
* @deprecated Use `.toBeAssignableWith()` or `.toBeAssignableTo()` instead. This matcher will be removed in TSTyche 3.
|
|
111
|
-
* To learn more, visit https://tstyche.org/release-notes/tstyche-2.
|
|
112
|
-
*/
|
|
113
|
-
<Target>(): void;
|
|
114
|
-
/**
|
|
115
|
-
* Checks if the source type is assignable with type of the target expression.
|
|
116
|
-
*
|
|
117
|
-
* @deprecated Use `.toBeAssignableWith()` or `.toBeAssignableTo()` instead. This matcher will be removed in TSTyche 3.
|
|
118
|
-
* To learn more, visit https://tstyche.org/release-notes/tstyche-2.
|
|
119
|
-
*/
|
|
120
|
-
(target: unknown): void;
|
|
121
|
-
};
|
|
122
100
|
/**
|
|
123
101
|
* Checks if the source type is assignable to the target type.
|
|
124
102
|
*/
|
|
@@ -145,42 +123,26 @@ interface Matchers {
|
|
|
145
123
|
*/
|
|
146
124
|
(target: unknown): void;
|
|
147
125
|
};
|
|
148
|
-
/**
|
|
149
|
-
* Checks if the source type is identical to the target type.
|
|
150
|
-
*
|
|
151
|
-
* @deprecated Use `.toBe()` instead. This matcher will be removed in TSTyche 3.
|
|
152
|
-
* To learn more, visit https://tstyche.org/release-notes/tstyche-2.
|
|
153
|
-
*/
|
|
154
|
-
toEqual: {
|
|
155
|
-
/**
|
|
156
|
-
* Checks if the source type is identical to the target type.
|
|
157
|
-
*
|
|
158
|
-
* @deprecated Use `.toBe()` instead. This matcher will be removed in TSTyche 3.
|
|
159
|
-
* To learn more, visit https://tstyche.org/release-notes/tstyche-2.
|
|
160
|
-
*/
|
|
161
|
-
<Target>(): void;
|
|
162
|
-
/**
|
|
163
|
-
* Checks if the source type is identical to type of the target expression.
|
|
164
|
-
*
|
|
165
|
-
* @deprecated This matcher will be removed in TSTyche 3.
|
|
166
|
-
* To learn more, visit https://tstyche.org/release-notes/tstyche-2.
|
|
167
|
-
*/
|
|
168
|
-
(target: unknown): void;
|
|
169
|
-
};
|
|
170
126
|
/**
|
|
171
127
|
* Checks if a property key exists on the source type.
|
|
172
128
|
*/
|
|
173
129
|
toHaveProperty: (key: string | number | symbol) => void;
|
|
174
130
|
/**
|
|
175
131
|
* Checks if the source type matches the target type.
|
|
132
|
+
*
|
|
133
|
+
* @deprecated This matcher will be removed in TSTyche 4. To learn more, visit https://tstyche.org/release-notes/tstyche-3.
|
|
176
134
|
*/
|
|
177
135
|
toMatch: {
|
|
178
136
|
/**
|
|
179
137
|
* Checks if the source type matches the target type.
|
|
138
|
+
*
|
|
139
|
+
* @deprecated This matcher will be removed in TSTyche 4. To learn more, visit https://tstyche.org/release-notes/tstyche-3.
|
|
180
140
|
*/
|
|
181
141
|
<Target>(): void;
|
|
182
142
|
/**
|
|
183
143
|
* Checks if the source type matches type of the target expression.
|
|
144
|
+
*
|
|
145
|
+
* @deprecated This matcher will be removed in TSTyche 4. To learn more, visit https://tstyche.org/release-notes/tstyche-3.
|
|
184
146
|
*/
|
|
185
147
|
(target: unknown): void;
|
|
186
148
|
};
|
|
@@ -340,6 +302,18 @@ interface Expect {
|
|
|
340
302
|
};
|
|
341
303
|
};
|
|
342
304
|
}
|
|
305
|
+
/**
|
|
306
|
+
* Builds an assertion.
|
|
307
|
+
*/
|
|
308
|
+
declare const expect: Expect;
|
|
309
|
+
/**
|
|
310
|
+
* Reshapes type of the given object by removing the specified keys.
|
|
311
|
+
*/
|
|
312
|
+
declare function omit<T, K extends PropertyKey>(object: T, ...keys: [K, ...Array<K>]): Omit<T, K>;
|
|
313
|
+
/**
|
|
314
|
+
* Reshapes type of the given object by keeping only the specified keys.
|
|
315
|
+
*/
|
|
316
|
+
declare function pick<T, K extends keyof T>(object: T, ...keys: [K, ...Array<K>]): Pick<T, K>;
|
|
343
317
|
/**
|
|
344
318
|
* Defines a test group.
|
|
345
319
|
*/
|
|
@@ -352,9 +326,5 @@ declare const test: Test;
|
|
|
352
326
|
* Defines a single test.
|
|
353
327
|
*/
|
|
354
328
|
declare const it: Test;
|
|
355
|
-
/**
|
|
356
|
-
* Builds an assertion.
|
|
357
|
-
*/
|
|
358
|
-
declare const expect: Expect;
|
|
359
329
|
|
|
360
|
-
export { describe, expect, it, test };
|
|
330
|
+
export { describe, expect, it, omit, pick, test };
|
package/build/index.d.ts
CHANGED
|
@@ -97,28 +97,6 @@ interface Matchers {
|
|
|
97
97
|
*/
|
|
98
98
|
(target: unknown): void;
|
|
99
99
|
};
|
|
100
|
-
/**
|
|
101
|
-
* Checks if the source type is assignable with the target type.
|
|
102
|
-
*
|
|
103
|
-
* @deprecated Use `.toBeAssignableWith()` or `.toBeAssignableTo()` instead. This matcher will be removed in TSTyche 3.
|
|
104
|
-
* To learn more, visit https://tstyche.org/release-notes/tstyche-2.
|
|
105
|
-
*/
|
|
106
|
-
toBeAssignable: {
|
|
107
|
-
/**
|
|
108
|
-
* Checks if the source type is assignable with the target type.
|
|
109
|
-
*
|
|
110
|
-
* @deprecated Use `.toBeAssignableWith()` or `.toBeAssignableTo()` instead. This matcher will be removed in TSTyche 3.
|
|
111
|
-
* To learn more, visit https://tstyche.org/release-notes/tstyche-2.
|
|
112
|
-
*/
|
|
113
|
-
<Target>(): void;
|
|
114
|
-
/**
|
|
115
|
-
* Checks if the source type is assignable with type of the target expression.
|
|
116
|
-
*
|
|
117
|
-
* @deprecated Use `.toBeAssignableWith()` or `.toBeAssignableTo()` instead. This matcher will be removed in TSTyche 3.
|
|
118
|
-
* To learn more, visit https://tstyche.org/release-notes/tstyche-2.
|
|
119
|
-
*/
|
|
120
|
-
(target: unknown): void;
|
|
121
|
-
};
|
|
122
100
|
/**
|
|
123
101
|
* Checks if the source type is assignable to the target type.
|
|
124
102
|
*/
|
|
@@ -145,42 +123,26 @@ interface Matchers {
|
|
|
145
123
|
*/
|
|
146
124
|
(target: unknown): void;
|
|
147
125
|
};
|
|
148
|
-
/**
|
|
149
|
-
* Checks if the source type is identical to the target type.
|
|
150
|
-
*
|
|
151
|
-
* @deprecated Use `.toBe()` instead. This matcher will be removed in TSTyche 3.
|
|
152
|
-
* To learn more, visit https://tstyche.org/release-notes/tstyche-2.
|
|
153
|
-
*/
|
|
154
|
-
toEqual: {
|
|
155
|
-
/**
|
|
156
|
-
* Checks if the source type is identical to the target type.
|
|
157
|
-
*
|
|
158
|
-
* @deprecated Use `.toBe()` instead. This matcher will be removed in TSTyche 3.
|
|
159
|
-
* To learn more, visit https://tstyche.org/release-notes/tstyche-2.
|
|
160
|
-
*/
|
|
161
|
-
<Target>(): void;
|
|
162
|
-
/**
|
|
163
|
-
* Checks if the source type is identical to type of the target expression.
|
|
164
|
-
*
|
|
165
|
-
* @deprecated This matcher will be removed in TSTyche 3.
|
|
166
|
-
* To learn more, visit https://tstyche.org/release-notes/tstyche-2.
|
|
167
|
-
*/
|
|
168
|
-
(target: unknown): void;
|
|
169
|
-
};
|
|
170
126
|
/**
|
|
171
127
|
* Checks if a property key exists on the source type.
|
|
172
128
|
*/
|
|
173
129
|
toHaveProperty: (key: string | number | symbol) => void;
|
|
174
130
|
/**
|
|
175
131
|
* Checks if the source type matches the target type.
|
|
132
|
+
*
|
|
133
|
+
* @deprecated This matcher will be removed in TSTyche 4. To learn more, visit https://tstyche.org/release-notes/tstyche-3.
|
|
176
134
|
*/
|
|
177
135
|
toMatch: {
|
|
178
136
|
/**
|
|
179
137
|
* Checks if the source type matches the target type.
|
|
138
|
+
*
|
|
139
|
+
* @deprecated This matcher will be removed in TSTyche 4. To learn more, visit https://tstyche.org/release-notes/tstyche-3.
|
|
180
140
|
*/
|
|
181
141
|
<Target>(): void;
|
|
182
142
|
/**
|
|
183
143
|
* Checks if the source type matches type of the target expression.
|
|
144
|
+
*
|
|
145
|
+
* @deprecated This matcher will be removed in TSTyche 4. To learn more, visit https://tstyche.org/release-notes/tstyche-3.
|
|
184
146
|
*/
|
|
185
147
|
(target: unknown): void;
|
|
186
148
|
};
|
|
@@ -340,6 +302,18 @@ interface Expect {
|
|
|
340
302
|
};
|
|
341
303
|
};
|
|
342
304
|
}
|
|
305
|
+
/**
|
|
306
|
+
* Builds an assertion.
|
|
307
|
+
*/
|
|
308
|
+
declare const expect: Expect;
|
|
309
|
+
/**
|
|
310
|
+
* Reshapes type of the given object by removing the specified keys.
|
|
311
|
+
*/
|
|
312
|
+
declare function omit<T, K extends PropertyKey>(object: T, ...keys: [K, ...Array<K>]): Omit<T, K>;
|
|
313
|
+
/**
|
|
314
|
+
* Reshapes type of the given object by keeping only the specified keys.
|
|
315
|
+
*/
|
|
316
|
+
declare function pick<T, K extends keyof T>(object: T, ...keys: [K, ...Array<K>]): Pick<T, K>;
|
|
343
317
|
/**
|
|
344
318
|
* Defines a test group.
|
|
345
319
|
*/
|
|
@@ -352,9 +326,5 @@ declare const test: Test;
|
|
|
352
326
|
* Defines a single test.
|
|
353
327
|
*/
|
|
354
328
|
declare const it: Test;
|
|
355
|
-
/**
|
|
356
|
-
* Builds an assertion.
|
|
357
|
-
*/
|
|
358
|
-
declare const expect: Expect;
|
|
359
329
|
|
|
360
|
-
export { describe, expect, it, test };
|
|
330
|
+
export { describe, expect, it, omit, pick, test };
|
package/build/index.js
CHANGED
|
@@ -9,4 +9,4 @@ const noopChain = new Proxy(doNothing, {
|
|
|
9
9
|
},
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
export { noopChain as describe, noopChain as expect, noopChain as it, noopChain as test };
|
|
12
|
+
export { noopChain as describe, noopChain as expect, noopChain as it, doNothing as omit, doNothing as pick, noopChain as test };
|