SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Using TypeScript, ESLint and Cypress
Build Testable
React App
Fahmi Idris
Frontend Engineer at Kata.ai
General Lead FrontenDev
Email: fahmi@kata.ai
Phone: +6289-777-033-19
+
+ +
–React Lovers
“you’re rockstar”
“let’s say about TypeScript”
–It is a strict syntactical superset of JavaScript
“TypeScript”
why TypeScript?
• TypeScript simplifies JavaScript code, making it easier to read and debug.
• TypeScript is open source.
• TypeScript provides highly productive development tools for JavaScript
IDEs and practices, like static checking.
• TypeScript makes code easier to read and understand.
• With TypeScript, we can make a huge improvement over plain JavaScript.
• TypeScript gives us all the benefits of ES6 (ECMAScript 6), plus more
productivity.
• TypeScript can help us to avoid painful bugs that developers commonly
run into when writing JavaScript by type checking the code.
• Structural
• Powerful type system, including generics.
• TypeScript code can be compiled as per ES5 and ES6 standards to support
the latest browser.
• Aligned with ECMAScript for compatibility.
• Starts and ends with JavaScript.
• Supports static typing.
• TypeScript will save developers time.
• TypeScript is a superset of ES3, ES5, and ES6.
https://devopedia.org/typescript
pros
• Object Oriented Programming Features
• TypeScript Does Not Need a Runtime Plugin
• Back-end Developer Feel More Comfortable With it
• It is Used in Popular Frameworks
cons
• Learning Curve
• Needs Development Tooling
• Cannot Easily be Edited by Content Management Systems (CMS)
who’s using TypeScript
And absolutely kata.ai using TypeScript
–is a static code analysis tool for identifying
problematic patterns in JavaScript code
“ESLint”
why ESLint?
- Enforce Standards Programmatically
By programmatically enforcing standards, teams save time and prevent team head butting
why ESLint?
- Automate Code Quality
There are three common ways to enforce linting in your development process
• IDE - Download ESLint for your favorite editor by following the ESLint guide This will
show you problems to fix quick and easy before trying to commit.
• Pre-commit - Check out the Lint-Staged module to run linting against newly staged
files, disallowing commits if any linting errors are found!
• Pipeline - Add linting into your pipeline to prevent any deployments with errors,
preventing developers from completing stories when errors are found!
why ESLint?
- Code Maintenance
Enforcing standards that to prevent long discussion and ego battles, along with preventing
developers from committing to the code base unless they adhere to the agreed standards are
the first two big wins for using a linter like ESLint
who’s using ESLint
And absolutely kata.ai using ESLint to, but it's still a migration stage :D
–is a Javascript End to End testing framework
“Cypress”
+ +
+
–React Lovers
“amazing”
why Cypress?
• Cypress does not use Selenium.
• Cypress focuses on doing end-to-end testing REALLY well.
• Cypress works on any front-end framework or website.
• Cypress tests are only written in JavaScript.
• Cypress is all in one.
• Cypress is for developers and QA engineers.
• Cypress runs much, much faster.
pro-tips using Cypress
• Use `data-` attributes as element selector
• Use 70/20/10 mantra, 70% unit tests, 20% integration tests, and 10% end-to-end tests
• Run Cypress on your own CI
• Record success and failure videos
“demo time”
“thanks”

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Continuous delivery applied (RJUG)
Continuous delivery applied (RJUG)Continuous delivery applied (RJUG)
Continuous delivery applied (RJUG)
 
Cypress report
Cypress reportCypress report
Cypress report
 
Serverless
ServerlessServerless
Serverless
 
[English][Test Girls] Zero to Hero: Start Test automation with Cypress
[English][Test Girls] Zero to Hero: Start Test automation with Cypress[English][Test Girls] Zero to Hero: Start Test automation with Cypress
[English][Test Girls] Zero to Hero: Start Test automation with Cypress
 
QA Challenge Accepted 4.0 - Cypress vs. Selenium
QA Challenge Accepted 4.0 - Cypress vs. SeleniumQA Challenge Accepted 4.0 - Cypress vs. Selenium
QA Challenge Accepted 4.0 - Cypress vs. Selenium
 
End to end test automation with cypress
End to end test automation with cypressEnd to end test automation with cypress
End to end test automation with cypress
 
Introduction to Integration Testing With Cypress
Introduction to Integration Testing With CypressIntroduction to Integration Testing With Cypress
Introduction to Integration Testing With Cypress
 
Cypress e2e automation testing - day1 intor by: Hassan Hameed
Cypress e2e automation testing -  day1 intor by: Hassan HameedCypress e2e automation testing -  day1 intor by: Hassan Hameed
Cypress e2e automation testing - day1 intor by: Hassan Hameed
 
Build and deploy to the cloud using NetflixOSS (Gradle Summit 2016)
Build and deploy to the cloud using NetflixOSS (Gradle Summit 2016)Build and deploy to the cloud using NetflixOSS (Gradle Summit 2016)
Build and deploy to the cloud using NetflixOSS (Gradle Summit 2016)
 
Continuous Integration - What even is it?
Continuous Integration - What even is it?Continuous Integration - What even is it?
Continuous Integration - What even is it?
 
Docker в автоматизации тестирования
Docker в автоматизации тестированияDocker в автоматизации тестирования
Docker в автоматизации тестирования
 
TDD on OSGi, in practice.
TDD on OSGi, in practice.TDD on OSGi, in practice.
TDD on OSGi, in practice.
 
Tooling for the productive front end developer
Tooling for the productive front end developerTooling for the productive front end developer
Tooling for the productive front end developer
 
.Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013
.Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013 .Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013
.Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013
 
Tooling for the productive front-end developer
Tooling for the productive front-end developerTooling for the productive front-end developer
Tooling for the productive front-end developer
 
Louisville Software Engineering Meet Up: Continuous Integration Using Jenkins
Louisville Software Engineering Meet Up: Continuous Integration Using JenkinsLouisville Software Engineering Meet Up: Continuous Integration Using Jenkins
Louisville Software Engineering Meet Up: Continuous Integration Using Jenkins
 
Continuous Delivery for Front-End Engineers
Continuous Delivery for Front-End EngineersContinuous Delivery for Front-End Engineers
Continuous Delivery for Front-End Engineers
 
Deploy an Asp.Net Core App on Azure
Deploy an Asp.Net Core App on AzureDeploy an Asp.Net Core App on Azure
Deploy an Asp.Net Core App on Azure
 
Branching Strategies: Feature Branches vs Branch by Abstraction
Branching Strategies: Feature Branches vs Branch by AbstractionBranching Strategies: Feature Branches vs Branch by Abstraction
Branching Strategies: Feature Branches vs Branch by Abstraction
 
Ice breaker with dev ops
Ice breaker with dev opsIce breaker with dev ops
Ice breaker with dev ops
 

Ähnlich wie Build testable react app

NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET
Dmytro Mindra
 
Emulators as an Emerging Best Practice for API Providers
Emulators as an Emerging Best Practice for API ProvidersEmulators as an Emerging Best Practice for API Providers
Emulators as an Emerging Best Practice for API Providers
Cisco DevNet
 
Build automation best practices
Build automation best practicesBuild automation best practices
Build automation best practices
Code Mastery
 
Introduction to-automated-testing
Introduction to-automated-testingIntroduction to-automated-testing
Introduction to-automated-testing
BestBrains
 

Ähnlich wie Build testable react app (20)

Bootstrapping Quality
Bootstrapping QualityBootstrapping Quality
Bootstrapping Quality
 
Topic production code
Topic production codeTopic production code
Topic production code
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET
 
Emulators as an Emerging Best Practice for API Providers
Emulators as an Emerging Best Practice for API ProvidersEmulators as an Emerging Best Practice for API Providers
Emulators as an Emerging Best Practice for API Providers
 
JS-formatter
JS-formatterJS-formatter
JS-formatter
 
Test Driven Development and Automation
Test Driven Development and AutomationTest Driven Development and Automation
Test Driven Development and Automation
 
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScript
 
Build automation best practices
Build automation best practicesBuild automation best practices
Build automation best practices
 
Javascript best practices
Javascript best practicesJavascript best practices
Javascript best practices
 
Programming languages and techniques for today’s embedded andIoT world
Programming languages and techniques for today’s embedded andIoT worldProgramming languages and techniques for today’s embedded andIoT world
Programming languages and techniques for today’s embedded andIoT world
 
Dev ops ci-ap-is-oh-my_security-gone-agile_ut-austin
Dev ops ci-ap-is-oh-my_security-gone-agile_ut-austinDev ops ci-ap-is-oh-my_security-gone-agile_ut-austin
Dev ops ci-ap-is-oh-my_security-gone-agile_ut-austin
 
Introduction to Automated Testing
Introduction to Automated TestingIntroduction to Automated Testing
Introduction to Automated Testing
 
Introduction to-automated-testing
Introduction to-automated-testingIntroduction to-automated-testing
Introduction to-automated-testing
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software Testing
 
Case study
Case studyCase study
Case study
 
Serverless java
Serverless   javaServerless   java
Serverless java
 
Shift left-csun-sagar-barbhaya
Shift left-csun-sagar-barbhayaShift left-csun-sagar-barbhaya
Shift left-csun-sagar-barbhaya
 
Continuous delivery @wcap 5-09-2013
Continuous delivery   @wcap 5-09-2013Continuous delivery   @wcap 5-09-2013
Continuous delivery @wcap 5-09-2013
 

Mehr von Malang QA Community

Mehr von Malang QA Community (20)

Driving Software Quality Across Platform
Driving Software Quality Across PlatformDriving Software Quality Across Platform
Driving Software Quality Across Platform
 
Driving Software Quality Across Platform
Driving Software Quality Across PlatformDriving Software Quality Across Platform
Driving Software Quality Across Platform
 
USABILITY TESTING TO IMPROVE USER EXPERIENCE
USABILITY  TESTING TO  IMPROVE USER EXPERIENCEUSABILITY  TESTING TO  IMPROVE USER EXPERIENCE
USABILITY TESTING TO IMPROVE USER EXPERIENCE
 
CI CD react app with docker
CI CD react app with dockerCI CD react app with docker
CI CD react app with docker
 
Automated test Using NodeJS
Automated test Using NodeJSAutomated test Using NodeJS
Automated test Using NodeJS
 
Refine your ci:cd pipeline with automated test
Refine your ci:cd pipeline with automated testRefine your ci:cd pipeline with automated test
Refine your ci:cd pipeline with automated test
 
Build testable laravel app
Build testable laravel appBuild testable laravel app
Build testable laravel app
 
Build testable laravel app
Build testable laravel appBuild testable laravel app
Build testable laravel app
 
The Importance of clearly defined requirements
The Importance of clearly defined requirementsThe Importance of clearly defined requirements
The Importance of clearly defined requirements
 
Test Case Management Tools
Test Case Management ToolsTest Case Management Tools
Test Case Management Tools
 
Scrum myth buster
Scrum myth busterScrum myth buster
Scrum myth buster
 
Technical documentation in software development types, best practices, and t...
Technical documentation in software development  types, best practices, and t...Technical documentation in software development  types, best practices, and t...
Technical documentation in software development types, best practices, and t...
 
How to survive in industrial world
How to survive in industrial worldHow to survive in industrial world
How to survive in industrial world
 
Peranan SQA dalam bisnis (mobayar)
Peranan SQA dalam bisnis (mobayar)Peranan SQA dalam bisnis (mobayar)
Peranan SQA dalam bisnis (mobayar)
 
E2 e test with testcafe
E2 e test with testcafeE2 e test with testcafe
E2 e test with testcafe
 
Agile Testing
Agile TestingAgile Testing
Agile Testing
 
Software testing fundamental Part 2
Software testing fundamental Part 2Software testing fundamental Part 2
Software testing fundamental Part 2
 
Software testing fundamental Part 1
Software testing fundamental Part 1Software testing fundamental Part 1
Software testing fundamental Part 1
 
Introduction to software quality assurance
Introduction to software quality assuranceIntroduction to software quality assurance
Introduction to software quality assurance
 
Meetup #5 API Testing World
Meetup #5 API Testing WorldMeetup #5 API Testing World
Meetup #5 API Testing World
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Build testable react app

  • 1. Using TypeScript, ESLint and Cypress Build Testable React App
  • 2. Fahmi Idris Frontend Engineer at Kata.ai General Lead FrontenDev Email: fahmi@kata.ai Phone: +6289-777-033-19
  • 3.
  • 4. +
  • 5. + +
  • 7.
  • 8. “let’s say about TypeScript”
  • 9. –It is a strict syntactical superset of JavaScript “TypeScript”
  • 10. why TypeScript? • TypeScript simplifies JavaScript code, making it easier to read and debug. • TypeScript is open source. • TypeScript provides highly productive development tools for JavaScript IDEs and practices, like static checking. • TypeScript makes code easier to read and understand. • With TypeScript, we can make a huge improvement over plain JavaScript. • TypeScript gives us all the benefits of ES6 (ECMAScript 6), plus more productivity. • TypeScript can help us to avoid painful bugs that developers commonly run into when writing JavaScript by type checking the code. • Structural • Powerful type system, including generics. • TypeScript code can be compiled as per ES5 and ES6 standards to support the latest browser. • Aligned with ECMAScript for compatibility. • Starts and ends with JavaScript. • Supports static typing. • TypeScript will save developers time. • TypeScript is a superset of ES3, ES5, and ES6.
  • 12.
  • 13. pros • Object Oriented Programming Features • TypeScript Does Not Need a Runtime Plugin • Back-end Developer Feel More Comfortable With it • It is Used in Popular Frameworks
  • 14. cons • Learning Curve • Needs Development Tooling • Cannot Easily be Edited by Content Management Systems (CMS)
  • 15. who’s using TypeScript And absolutely kata.ai using TypeScript
  • 16. –is a static code analysis tool for identifying problematic patterns in JavaScript code “ESLint”
  • 17. why ESLint? - Enforce Standards Programmatically By programmatically enforcing standards, teams save time and prevent team head butting
  • 18. why ESLint? - Automate Code Quality There are three common ways to enforce linting in your development process • IDE - Download ESLint for your favorite editor by following the ESLint guide This will show you problems to fix quick and easy before trying to commit. • Pre-commit - Check out the Lint-Staged module to run linting against newly staged files, disallowing commits if any linting errors are found! • Pipeline - Add linting into your pipeline to prevent any deployments with errors, preventing developers from completing stories when errors are found!
  • 19. why ESLint? - Code Maintenance Enforcing standards that to prevent long discussion and ego battles, along with preventing developers from committing to the code base unless they adhere to the agreed standards are the first two big wins for using a linter like ESLint
  • 20.
  • 21. who’s using ESLint And absolutely kata.ai using ESLint to, but it's still a migration stage :D
  • 22. –is a Javascript End to End testing framework “Cypress”
  • 23. + + +
  • 25. why Cypress? • Cypress does not use Selenium. • Cypress focuses on doing end-to-end testing REALLY well. • Cypress works on any front-end framework or website. • Cypress tests are only written in JavaScript. • Cypress is all in one. • Cypress is for developers and QA engineers. • Cypress runs much, much faster.
  • 26.
  • 27. pro-tips using Cypress • Use `data-` attributes as element selector • Use 70/20/10 mantra, 70% unit tests, 20% integration tests, and 10% end-to-end tests • Run Cypress on your own CI • Record success and failure videos

Hinweis der Redaktion

  1. TypeScript is designed for development of large applications and transcompiles to JavaScript. As TypeScript is a superset of JavaScript, existing JavaScript programs are also valid TypeScript programs. TypeScript may be used to develop JavaScript applications for both client-side and server-side (Node.js, Deno) execution. There are multiple options available for transcompilation. Either the default TypeScript Checker can be used, or the Babel compiler can be invoked to convert TypeScript to JavaScript
  2. ESLint is an open source project originally created by Nicholas C. Zakas in June 2013. Its goal is to provide a pluggable linting utility for JavaScript.
  3. Cypress gives you a solid platform for writing and automating UI tests. Without worrying too much about the rest