LoginSignup
51
29

More than 5 years have passed since last update.

Jestで標準出力(console.log())してデバッグする方法

Last updated at Posted at 2018-12-18

概要

引数を与えてあげればできる。

デフォルトでは --silent がtrueなので --silent=false を指定すればOK。

実行コマンド

jest --silent=false

しかし、このままだとテスト対象ファイルのconsole.logしか表示できない。

テストファイル自体のconsole.logなどを表示したい場合は--verbose falseを実行時コマンドに含める必要がある。

つまり、全てのconsole.logを表示したい場合は

jest --silent=false --verbose false

以上のコマンドを実行すればOK。

参考リンク

Jest CLI Options · Jest

51
29
0

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
51
29