Skip to content

Commit

Permalink
Remove test import in README.md (#65)
Browse files Browse the repository at this point in the history
## This PR:

  - [X] Resolves #63.
  • Loading branch information
aryaemami59 authored Mar 21, 2024
1 parent 9cda9e0 commit 9015dcd
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ Similar to Jest's `expect`, but with type-awareness. Gives you access to a numbe
import {expectTypeOf} from 'expect-type'
import {foo, bar} from '../foo'

test('foo types', () => {
// make sure `foo` has type {a: number}
expectTypeOf(foo).toMatchTypeOf<{a: number}>()

// make sure `bar` is a function taking a string:
expectTypeOf(bar).parameter(0).toBeString()
expectTypeOf(bar).returns.not.toBeAny()
})
// make sure `foo` has type {a: number}
expectTypeOf(foo).toMatchTypeOf<{a: number}>()

// make sure `bar` is a function taking a string:
expectTypeOf(bar).parameter(0).toBeString()
expectTypeOf(bar).returns.not.toBeAny()
```

It can be used in your existing test files - or any other type-checked file you'd like - it's built into existing tooling with no dependencies. No extra build step, cli tool, IDE extension, or lint plugin is needed. Just import the function and start writing tests. Failures will be at compile time - they'll appear in your IDE and when you run `tsc`.
Expand Down

0 comments on commit 9015dcd

Please sign in to comment.