Manjula Dube
Senior Developer @Bookmyshow
Organizer @Mumbai Women Coders
Google Developer Group - Mumbai Chapter
@manjula_dube
Do you really test?
We just love the
Existing Problems
Text
More Effort => Less Tests
Less Effort => More Tests
Text
If you are writing tests:
you are already winning
If you are not writing tests:
let me encourage you to start
How do we prevent bugs?
Text
1. Flow -Static Type Checker
Text
Text
2. Linting: ESLint
3. Testing?????
Testing?
Catch some bugs before they can happen...
Text
Write better code
Stability
Executable documentation
What kinds of testing can we do?
Text
Usability Testing
Performance Testing
Penetration Testing
Integration Testing
E2E Testing
Regression Testing
Smoke Testing
Unit Testing
Fuzz Testing
Stress Testing
Text
TOOLS/FRAMEWORKS
Text
Ch
Function
COMPONENTS
REDUCERS
ACTIONS
Unit testing in React app?
Text
Text
How do we test our react components?
Zero Configuration
Instant run
Text
Text
Snapshot testing
Code coverage
Interactive watch mode
Setting up Jest
npm install --save-dev jest
OR
yarn add --dev jest
Text
What is Snapshot Testing?
How does snapshot work?
jest --updateSnapshot
Snapshots Benefits
Automate process, to manage snapshots
Adapt changes
Text
Easy to maintain
Lets test the Action button component on BookMyShow.
Text
<ActionButton/>
Text
Text
Text
Text
Jest v/s Enzyme?
Enzyme is a javascript testing utility for React that makes it easier to assert, manipulate, and traverse your React Components' output.
Shortcomings of using jest.
Merge conflicts
Overuse
You can’t TDD
Text
Logical bugs can still persist based on varying app behaviours.
Text
How testing helped us?
Should I use them or not?
Thankyou
@manjula_dube
Convinced you to write more of test cases
Happy testing :)
https://medium.com/@manjuladube