Skip to content

Commit 93dbd12

Browse files
authored
docs(issue): Added infomation about typescript issue
1 parent 1ad815f commit 93dbd12

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,21 @@ describe('test using yet-another-fetch-mock', () => {
119119
```
120120

121121

122-
#### Types
122+
#### Typescript
123123
Full documentation of types can be seen [here](https://www.utgaard.xyz/yet-another-fetch-mock/),
124124
or [here](https://github.com/nutgaard/yet-another-fetch-mock/blob/master/src/types.ts) if you prefer reading typescript code.
125125

126+
##### !!!NB!!!
127+
128+
**Known issue:**
129+
`Argument of type '({ queryParams }: HandlerArgument) => MyDataInterface' is not assignable to parameter of type 'MockHandler'.`
130+
The solution is often to ensure that `MyDataInterface` is also a `JsonObject`.
131+
E.g
132+
```
133+
mock.get('/my-url', () => mockData as MyDataInterface & JsonObject)
134+
```
135+
136+
126137

127138
### Tips
128139

0 commit comments

Comments
 (0)