Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions guide/testing-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test('my types work properly', () => {
expectTypeOf(mount).toBeFunction()
expectTypeOf(mount).parameter(0).toExtend<{ name: string }>()

// @ts-expect-error name is a string
// @ts-expect-error 名称为字符串
assertType(mount({ name: 42 }))
})
```
Expand Down Expand Up @@ -106,7 +106,7 @@ expectTypeOf(one).toEqualTypeOf<typeof two>()
const answer = 42

assertType<number>(answer)
// @ts-expect-error answer is not a string
// @ts-expect-error 答案不是字符串
assertType<string>(answer)
```

Expand All @@ -116,7 +116,7 @@ assertType<string>(answer)
这将通过,因为它预计会出现错误,但 “answer” 这个词有错别字,所以这是一个误报错误:

```ts
// @ts-expect-error answer is not a string
// @ts-expect-error 答案不是字符串
assertType<string>(answr)
```

Expand Down