Vite+TypescriptのプロジェクトにVitestを導入する方法
Vitestのインストール
loading...
vite.config.ts編集
下記ハイライト行を追加
loading...
package.json編集
下記ハイライト行のnpm scriptsを追加
loading...
テスト用のファイル作成
srcディレクトリにテスト用の簡単なsum関数を作成します。
loading...
テストファイルの作成
loading...
テストの実行
npm run test
コマンドでテストを実行します。
loading...
loading...