↓ Ir para o conteúdo principal

← todas as notas

📎 Webclip

4 tools to supercharge your Jest Testing and increase your productivity while testing

The page argues that tests matter, but a fast feedback loop matters too. It recommends adding watch mode to package.json, using a typeahead plugin to find tests faster, extending matchers for clearer assertions, and failing on console output to keep test runs readable.

Reading notes
#

  • Add a test:watch script with jest --watch --verbose so test results update in real time and related tests rerun when files change.
  • Use jest-watch-typeahead to filter tests by file name or test name, which helps in large codebases with many tests.
  • Add jest-extended when default matchers are not enough and you want assertions that read more clearly, such as toHaveBeenCalledExactlyOnceWith, toThrowWithMessage, and toHaveBeenCalledAfter.
  • Use jest-fail-on-console to make tests fail on console.error(), console.warn(), and similar calls so leftover logs do not clutter the output.