توضیحاتی در مورد کتاب Simplify Testing with React Testing Library
نام کتاب : Simplify Testing with React Testing Library
عنوان ترجمه شده به فارسی : تست را با کتابخانه تست React ساده کنید
سری :
نویسندگان : Scottie Crump
ناشر :
سال نشر : 2021
تعداد صفحات : 246
ISBN (شابک) : 9781800564459
زبان کتاب : English
فرمت کتاب : pdf
حجم کتاب : 4 مگابایت
بعد از تکمیل فرایند پرداخت لینک دانلود کتاب ارائه خواهد شد. درصورت ثبت نام و ورود به حساب کاربری خود قادر خواهید بود لیست کتاب های خریداری شده را مشاهده فرمایید.
فهرست مطالب :
Cover
Title Page
Copyright and Credits
Dedication
Contributors
Table of Contents
Preface
Chapter 1: Exploring React Testing Library
Technical requirements
Introducing the DOM Testing Library
What is the DOM Testing Library?
Guiding principles
Executing test cases with Jest
Running tests with Jest
Enhancing Jest assertions with jest-dom
Adding jest-dom to a project
Advantages of using jest-dom with Jest
Testing implementation details
Problems with implementation detail-focused tests
Implementation detail-focused test example
How to move away from implementation detail testing
Summary
Questions
Chapter 2: Working with React Testing Library
Technical requirements
Adding React Testing Library to existing projects
Manual installation
Automatic installation with create-react-app
Structuring tests with React Testing Library
Rendering elements
Selecting elements in the component DOM output
Asserting expected behavior
Testing presentational components
Creating snapshot tests
Testing expected properties
Using the debug method
Debugging the entire component DOM
Debugging specific component elements
Summary
Questions
Chapter 3: Testing Complex Components with React Testing Library
Technical requirements
Testing user events
Simulating user actions with fireEvent
Simulating user actions with user-event
Testing components that call event handlers in isolation
Testing components that interact with APIs
Requesting API data with fetch
Creating mock API data with MSW
Testing the DrinkSearch component
Using MSW in development
Implementing test-driven development
Building the Vote component using TDD
Building a registration form using TDD
Summary
Questions
Chapter 4: Integration Testing and Third-Party Libraries in Your Application
Technical requirements
Testing integrated components
Using integration testing with the Vote component
Planning test scenarios better suited for isolated testing
Testing components that use the Context API
Testing a context consuming Retail component
Testing the Cart component in isolation
Testing the Product component in isolation
Testing the ProductDetail component in isolation
Testing context errors using error boundaries
Using integration testing to test view product details
Testing components that use Redux
Creating a custom render method for testing Redux consuming components
Using the test Redux Provider in tests
Testing components that use GraphQL
Testing Components that use Material-UI
Adding an ARIA label to test a Vote component
Adding a test ID to test a CustomerTable component
Summary
Questions
Chapter 5: Refactoring Legacy Applications with React Testing Library
Technical requirements
Using tests to catch regressions when updating dependencies
Creating the regression test suite
Upgrading the Material UI dependencies
Refactoring tests written with Enzyme
Refactoring tests written with ReactTestUtils
Refactoring tests to comply with common testing best practices
Summary
Questions
Chapter 6: Implementing Additional Tools and Plugins for Testing
Technical requirements
Implementing best practices with Testing Library ESLint plugins
Installing and configuring eslint-plugin-testing-library
Installing and configuring eslint-plugin-jest-dom
Testing accessibility with jest-axe
Selecting the best queries with Testing Playground
Selecting queries using the Testing Playground website
Selecting queries using the Testing Playground Chrome extension
Increasing our testing productivity with Wallaby.js
Installing and configuring Wallaby.js
Writing tests with Interactive Test Output
Summary
Questions
Chapter 7: End-to-End UI Testing with Cypress
Technical requirements
Getting started with Cypress
Enhancing Cypress commands with the Cypress Testing Library
Cypress-driven development
Writing Tests using Cypress design patterns
Creating page objects in Cypress
Creating custom Commands in Cypress
Testing APIs with Cypress
Writing Gherkin-style tests with Cucumber
Using React Developer Tools with Cypress
Summary
Questions
Answers
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Why subscribe?
About Packt
Other Books You May Enjoy
Index