Snapshot Testing: Use With Care

  • When writing Snapshot Tests that are intended to stick around, you need to be careful to write really solid test descriptions, because the body of the test no longer communicates anything about what’s important about the test case.
  • During future runs, the test will compare the latest JSON with the snapshot file.
  • Snapshot Testing in Jest was designed to make it easy to test React components, but it can be used for more than that.
  • The ability to quickly update a snapshot when it changes makes for a nicer, faster workflow.
  • It is definitely worth experimenting with Jest’s Snapshot Testing feature.

Snapshot Testing has been getting a fair bit of attention recently with some new tool support that makes it easy to use. But is that a good thing? …
Continue reading “Snapshot Testing: Use With Care”

Jest 15.0: New Defaults for Jest · Jest

@marekpiechut Mind updating this part? Jest does *not* mock by default anymore.

  • It can now switch between running all tests or only test files related to changed files by pressing a or o .
  • Jest now uses verbose mode when only a single test file is executed.
  • By pressing p a prompt appears that allows to specify a test pattern to focus on a specific set of files.
  • Jest used to implicitly reset all modules before each test and we recommended requiring modules in beforeEach or inside of tests.
  • When running multiple tests in parallel, it was often hard to find out which test and which module was calling a log function.

We spent the past year making Jest faster, easier to configure, added tons of features and built snapshot testing. However, there were two areas where we invested very little: the CLI output and user experience. With Jest 15 we are changing the framework radically to make it easier to use both for beginners and experienced users. We are excited that our investment in Jest is now paying off: we can move fast and improve the framework for Facebook and the open source community at light-speed. Jest’s goal is to come with batteries included and to require as little configuration as necessary. We recently got a chance to explain our philosophy on a create-react-app issue.
Continue reading “Jest 15.0: New Defaults for Jest · Jest”

Plotly Academy

This is very well explained by @mxstbr

  • Sign In SIGN UP NEW PROJECT UPGRADE REQUEST DEMO
  • Tutorials and workshops on the open-source stack used by @plotlygraphs
  • Feed Pricing Dashboards API PYTHON R MATLAB JAVASCRIPT MORE
  • Plotly Academy
  • FRONTEND DATA SCIENCE

Tutorials and workshops on the open-source stack used by @plotlygraphs
Continue reading “Plotly Academy”

Jest 14.0: React Tree Snapshot Testing · Jest

  • For Facebook’s native apps we use a system called “snapshot testing”: a snapshot test system that renders UI components, takes a screenshot and subsequently compares a recorded screenshot with changes made by an engineer.
  • As a result many people stopped writing tests altogether which eventually led to instabilities.
  • With snapshot testing I do not need the output files, the snapshots are generated for free by Jest!
  • Engineers frequently told us that they spend more time writing a test than the component itself.
  • import renderer from ‘react/lib/ReactTestRenderer’ ; test ( ‘Link renders correctly’ , ( ) = > { const tree = renderer .

Read the full article, click here.


@cpojer: “Jest 14.0: React Snapshot Testing, experimental React-Native support and future plans for Jest. Try it out now!”


One of Jest’s philosophies is to provide an integrated “zero-configuration” experience. We want to make it as frictionless as possible to write good tests that are useful. We observed that when engineers are provided with ready-to-use tools, they end up writing more tests, which in turn results in stable and healthy code bases.


Jest 14.0: React Tree Snapshot Testing · Jest