Skip to content

Commit fb4588c

Browse files
committed
docs(cn): dissolve the conflict
1 parent b2b9286 commit fb4588c

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

api/expect.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -782,27 +782,19 @@ test('the number of elements must match exactly', () => {
782782

783783
## toThrowError
784784

785-
<<<<<<< HEAD
786-
- **类型:** `(received: any) => Awaitable<void>`
787-
=======
788-
- **Type:** `(expected?: any) => Awaitable<void>`
789-
>>>>>>> 6777bfb4d65ef81facc3a8f09bbe129e90871655
785+
- **类型:** `(recexpectedeived: any) => Awaitable<void>`
790786

791787
- **别名:** `toThrow`
792788

793789
`toThrowError` 断言函数在被调用时是否会抛出错误。
794790

795791
我们可以提供一个可选参数来测试是否抛出了特定的错误:
796792

797-
<<<<<<< HEAD
798793
- `RegExp`: 错误消息匹配该模式
799794
- `string`: 错误消息包含该子字符串
800-
- `Error`, `AsymmetricMatcher`: 与接收到的对象进行比较,类似于 `toEqual(received)`
801-
=======
802-
- `RegExp`: error message matches the pattern
803-
- `string`: error message includes the substring
804795
- any other value: compare with thrown value using deep equality (similar to `toEqual`)
805-
>>>>>>> 6777bfb4d65ef81facc3a8f09bbe129e90871655
796+
797+
<!-- TODO: translation -->
806798

807799
:::tip
808800
必须将代码包装在一个函数中,否则错误将无法被捕获,测试将失败。
@@ -863,6 +855,8 @@ test('throws on pineapples', async () => {
863855

864856
:::
865857

858+
<!-- TODO: translation -->
859+
866860
:::tip
867861
You can also test non-Error values that are thrown:
868862

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export default antfu(
6969
'no-self-compare': 'off',
7070
'import/no-mutable-exports': 'off',
7171
'no-restricted-globals': 'off',
72+
'no-throw-literal': 'off',
7273
},
7374
},
7475
)

0 commit comments

Comments
 (0)