Skip to content

Commit

Permalink
feat(interfaceCallSignature): add support for interface call signature (
Browse files Browse the repository at this point in the history
#82)

* add initial work to support interfaces with call signatures

* refactor mockCall with better variable names

* enable tests and make sure signature are not used when not provided

* add a test to cover function overload

* add documentation and intersection call signatures
  • Loading branch information
uittorio authored Oct 29, 2019
1 parent 2c31d28 commit a00ff55
Show file tree
Hide file tree
Showing 13 changed files with 1,637 additions and 1,580 deletions.
14 changes: 14 additions & 0 deletions docs/DETAILS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ interface Person {
name: ""
}
*/
```
## Interfaces with call signatures
For overload methods it will use the first one
```ts
interface Person {
(): number
(): string
name: string
}

const mock = createMock<Person>();
mock() // 0
mock.name // ""

```
## Classes
```ts
Expand Down
Loading

0 comments on commit a00ff55

Please sign in to comment.