LoginSignup
1

メモ書きです。

例外のテストを書きたい

const sum = (a: number, b: number) => a + b

今まで

sum.test.ts
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore-next-line
sum('1', 2)

最近知った

sum.test.ts
// @ts-expect-error: 例外チェック
sum('1', 2)

そんなんあったんか…

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1