a 4.0.6 → 4.0.7
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 -1
- package/index.d.ts +1 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
cd_a_
|
|
2
2
|
===
|
|
3
3
|
_Mocking framework_
|
|
4
4
|
|
|
@@ -121,6 +121,7 @@ mock({a : 2, b : {c : 'foo', d : ['me', 'too']}}); //returns 'fake3'
|
|
|
121
121
|
mock(obj); //returns 'fake4'
|
|
122
122
|
mock({}); //throws unexpected arguments
|
|
123
123
|
```
|
|
124
|
+
Note: Struct matching is strict on leaf properties. All leaf property values must be equal to match, and an empty object does not match a non-empty expected struct.
|
|
124
125
|
|
|
125
126
|
__Repeats__
|
|
126
127
|
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
|
-
|
|
3
1
|
type AnyFunction = (...args: any[]) => any;
|
|
4
2
|
type Tail<T extends any[]> = T extends [any, ...infer R] ? R : [];
|
|
5
3
|
type OverloadedParameters<T> = T extends {
|
|
@@ -26,9 +24,7 @@ type FunctionProps<T> = T extends (...args: any[]) => any
|
|
|
26
24
|
: {};
|
|
27
25
|
type MockedFunction<T extends AnyFunction> = MockFunction<
|
|
28
26
|
OverloadedParameters<T>,
|
|
29
|
-
T
|
|
30
|
-
? Promise<AxiosResponse<any, any, {}>>
|
|
31
|
-
: OverloadedReturnType<T>
|
|
27
|
+
OverloadedReturnType<T>
|
|
32
28
|
> &
|
|
33
29
|
T &
|
|
34
30
|
FunctionProps<T>;
|