Motomichi Works Blog

モトミチワークスブログです。その日学習したことについて書いている日記みたいなものです。

jest

Jestを実行したときに Object.values の記述箇所で TypeError: Cannot convert undefined or null to object at Function.values (<anonymous>) になったので修正する

解決したいこと HOGE は定数で import しているのに、以下のような感じでテストが失敗しました。 このテストが失敗しているファイルを example.tsx とします。 ● Test suite failed to run TypeError: Cannot convert undefined or null to object at Functi…

Jestを実行したときに Error [ERR_REQUIRE_ESM]: require() of ES Module になったので解決する

参照したページ Jest の実行環境のサンプル Jestでテストを書こう | TypeScript入門『サバイバルTypeScript』 はじめましょう · Jest yarn upgrade について yarn upgradeのあれこれ #CLI - Qiita Error [ERR_REQUIRE_ESM]: require() of ES Module の解消に…

jestのcustom reporterを作成してテスト実行結果をcsvファイルで出力する

参考にさせていただいたページ Configuring Jest · Jest Configuring Jest · Jest GitHub - mas0061/jest-allresult-csv-reporter: A Jest plugin. Output all test results to CSV. はじめに jestのテスト実行結果を出力するためのreporterは比較的簡単に自…