Skip to content

Commit

Permalink
add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Pmyl committed Dec 8, 2019
1 parent 1e26901 commit f367cdf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
27 changes: 26 additions & 1 deletion docs/DETAILS.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,29 @@ const mockType = createMock<new () => Test>();
const mock = new mockType();
mock = // { a: "" }
```
```
## TypeQuery
```ts
enum AnEnum {
a,
b = 'something',
}
const mock = createMock<typeof AnEnum>();
mock.a // 0
mock.b // 'something'
mock[0] // 'a'
class AClass {
a: string
}
const mockClass = createMock<typeof AClass>();
new mockClass().a // ''
function AFunction(): number;
const mockFunction = createMock<typeof AFunction>();
mockFunction() // 0
```
19 changes: 0 additions & 19 deletions docs/NOT_SUPPORTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,3 @@ const mock = createMock<Test>();

mock.conditional // should be string. It will be null
```

## TypeQuery
[bug](https://github.com/uittorio/ts-auto-mock/issues/91)

This scenario needs to be investigated
```ts
enum AnEnum {
a,
b,
}
interface Test {
type: typeof AnEnum
}

const mock = createMock<Test>();
mock.type // will be null
```


0 comments on commit f367cdf

Please sign in to comment.