Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Maintainable Integration Testing in React

Maintainable Integration Testing in React

Matija Marohnić

February 22, 2018
Tweet

More Decks by Matija Marohnić

Other Decks in Programming

Transcript

  1. •an afterthought, something to “deal with later” •not considered an

    essential part of development “Too much of a hassle”
  2. •e.g. some advanced APIs •async doesn’t help, it’s often about

    timing •developers skip challenging tests, but never return Some features are hard to test
  3. –Me “A test is useless if you’re equally likely to

    make a mistake in the implementation and the test itself.”
  4. •usually developers strive towards 100% •important in libraries and APIs

    •not really in frontend application code Test coverage
  5. •Enzyme •built on top of React’s test utilities •useful high-level

    API •Nock •imitates a server Companion tools
  6. •opening a DataGrid displays features of the currently selected layer

    Testing features Do Don’t •opening a DataGrid makes a certain API request
  7. •creating a filter causes features to reduce to an expected

    set Testing features Do Don’t •creating a filter displays a chip component