وب سایت تخصصی شرکت فرین
دسته بندی دوره ها

Real-World TypeScript Unit Testing

سرفصل های دوره

Create unit tests for real world typescript system with few modules using vitest or jest


1. Getting started
  • 1. Welcome to my course
  • 2. Setup simple unit test project
  • 3. Setup simple unit test project.html
  • 4. Create your first unit test
  • 5. Create your first unit test.html
  • 6. Coding Excercise 1
  • 7. Coding Excercise 1 solution

  • 2. Testing concepts and tools
  • 1. Section Intro
  • 2. What is testing
  • 3. What is testing.html
  • 4. Unit test vs integration test vs e2e test
  • 5. Unit test vs integration test vs e2e test.html
  • 6. Side effects
  • 7. Side effects.html
  • 8. Properties of a good unit test
  • 9. Properties of good unit test.html
  • 10. Manual test vs automatic test
  • 11. Manual test vs automatic test.html
  • 12. Motivation for automatic testing
  • 13. Motivation for automatic testing.html
  • 14. Should you test all your code
  • 15. Should you test all your code.html
  • 16. Unit testing best practices
  • 17. Unit testing best practices.html
  • 18. Unit testing modes
  • 19. Unit testing modes.html
  • 20. Unit testing framework vitest and jest
  • 21. Unit testing framework vitest and jest.html
  • 22. Vitest
  • 23. Vitest.html
  • 24. Jest
  • 25. Jest.html

  • 3. Task queue manager- the system we will unit test
  • 1. Section Intro
  • 2. Simple system UI
  • 3. Simple system UI.html
  • 4. Block diagram
  • 5. Block diagram.html
  • 6. Sequence diagram
  • 7. Sequence diagram.html
  • 8. Source code
  • 9. Source code.html
  • 10. Motivation
  • 11. Motivation.html
  • 12. Specification
  • 13. Specification.html
  • 14. Project structure
  • 15. Project structure.html

  • 4. Unit test of pure logic code - TaskQueue
  • 1. Section intro
  • 2. Directory final setup
  • 3. Unit test of an object or a class
  • 4. Unit test of an object or a class.html
  • 5. Choosing the first module to unit test
  • 6. Choosing the first module to unit test.html
  • 7. Setup unit test for TaskQueue
  • 8. Setup unit test for TaskQueue.html
  • 9. TaskQueue - test for empty queue
  • 10. TaskQueue - test for empty queue.html
  • 11. TaskQueue - test for non empty queue
  • 12. TaskQueue - test for non empty queue.html
  • 13. Fix the test using beforeEach and add clear function to TaskQueue
  • 14. Fix the test using beforeEach and add clear function.html
  • 15. Code at section end.html
  • 16. Coding Excercise 2
  • 17. Coding Excercise 2 - solution

  • 5. Code coverage
  • 1. Section intro
  • 2. Code coverage meaning and motivation
  • 3. Code coverage meaning and motivation.html
  • 4. Do we need 100% code coverage
  • 5. Do we need 100% code coverage.html
  • 6. Inatallation
  • 7. Inatallation.html
  • 8. Usage
  • 9. Usage.html
  • 10. Coding Excercise 3
  • 11. Coding Excercise 3 - solution

  • 6. Unit testing of pure logic code - TaskDispatcher
  • 1. Section intro
  • 2. Choose the second module to unit test
  • 3. Choose the second module to unit test.html
  • 4. Dive into TaskDispatch code
  • 5. Dive into TaskDispatch code.html
  • 6. Prepare the test file
  • 7. Prepare the test file.html
  • 8. Unit test empty map - dispatch throw
  • 9. Unit test empty map - dispatch throw.html
  • 10. Unit test task not found - dispatch throw
  • 11. Unit test task not found - dispatch throw.html
  • 12. Function type as function argument issue
  • 13. Function type as function argument issue.html
  • 14. Refactor types
  • 15. Refactor types.html
  • 16. Test dispatch status is ok
  • 17. Test dispatch status is ok.html
  • 18. Test reveal bug in dispatch - debug and fix
  • 19. Test reveal bug in dispatch - debug and fix.html
  • 20. Test dispatch result is ok for add function
  • 21. Test dispatch result is ok for add function.html
  • 22. Check code coverge
  • 23. Check code coverge.html
  • 24. How to filter tests
  • 25. How to filter tests.html
  • 26. Code at section end.html
  • 27. Coding Excercise 4
  • 28. Coding Excercise 4 - solution

  • 7. Introduction to unit testing of code with side effects and module interaction
  • 1. Section intro
  • 2. What is a side effect
  • 3. What is a side effect.html
  • 4. What is a mock
  • 5. What is a mock.html
  • 6. Motivation for mocks
  • 7. Motivation for mocks.html
  • 8. API for mocks
  • 9. API for mocks.html
  • 10. Modules with side effects and module interaction
  • 11. Modules with side effects and module interaction.html
  • 12. Solitary (isolated) test vs sociable test
  • 13. Solitary (isolated) test vs sociable test.html

  • 8. Unit test of persist with side effect
  • 1. Unit test using jsdom
  • 2. Unit test using jsdom.html
  • 3. Unit test with console.log and spyOn()
  • 4. Unit test with console.log and spyOn().html
  • 5. Unit test with Storage.prototype and spyOn()
  • 6. Unit test with Storage.prototype and spyOn().html
  • 7. Code at section end.html
  • 8. Coding Excercise 5
  • 9. Coding Excercise 5 - solution

  • 9. Unit test of TaskQueue with persist module interaction
  • 1. Unit test using sociable test
  • 2. Unit test using sociable test.html
  • 3. Motivation for unit test using isolated (solitary) test
  • 4. Motivation for unit test using isolated (solitary) test.html
  • 5. Using mock() and fn() for persist using isolated (solitary) test for TaskQueue
  • 6. Using mock() and fn() for persist using isolated (solitary).html
  • 7. Refactor taskQueue to a class
  • 8. Refactor taskQueue to a class.html
  • 9. Add persist related test cases and use sociable test for TaskQueue
  • 10. Add persist related test cases and use sociable test for TaskQueue.html
  • 11. Use isolated (solitary) test for added test cases
  • 12. Use isolated (solitary) test for added test cases.html
  • 13. Should you use sociable or isolated (solitary) test
  • 14. Should you use sociable or isolated (solitary) test.html
  • 15. Code at section end.html
  • 16. Coding Excercise 6
  • 17. Coding Excercise 6 - solution

  • 10. Unit test of TaskScheduler with fake timer and module interaction
  • 1. Test plan
  • 2. Test plan.html
  • 3. Use fake timers in unit test
  • 4. Use fake timers in unit test.html
  • 5. Test for result and add callback in TaskScheduler
  • 6. Test for result and add callback in TaskScheduler.html
  • 7. Finish the unit test
  • 8. Finish the unit test.html
  • 9. Summary unit test of TaskScheduler
  • 10. Code at section end.html
  • 11. Coding Excercise 7
  • 12. Coding Excercise 7 - solution

  • 11. Introduction to frontend unit testing
  • 1. Section intro - Where are we now and how to continue
  • 2. Where are we now and how to continue.html
  • 3. Dom unit testing tools
  • 4. Dom unit testing tools.html
  • 5. Download and invoke the UI
  • 6. Download and invoke the UI.html
  • 7. Code at section end.html

  • 12. Frontend unit testing with jsdom
  • 1. Jsdom setup and simple unit test for h1 text
  • 2. Jsdom setup and simple unit test for h1 text.html
  • 3. Unit test for buttons count and text
  • 4. Unit test for buttons count and text.html
  • 5. Elegant unit test for buttons using enum and loop
  • 6. Elegant unit test for buttons using enum and loop.html
  • 7. Powerful unit test for enqueue add(1,2) button
  • 8. Powerful unit test for enqueue add(1,2) button.html
  • 9. Unit test with spyOn to test queue length buttton
  • 10. Unit test with spyOn to test queue length buttton.html
  • 11. Use spyOn to test for failure to appear in the UI
  • 12. Use spyOn to test for failure to appear in the UI.html
  • 13.1 Code at lesson end.html
  • 13. More jsdom unit test to get 100% coverage
  • 14. More jsdom unit test to get 100% coverage.html
  • 15. Code at section end.html
  • 16. Coding Excercise 8
  • 17. Coding Excercise 8 - solution

  • 13. Frontend unit testing with dom testing library
  • 1. Introduction and motivation for testing library
  • 2. Introduction and motivation for testing library.html
  • 3. Setup for dom testing library
  • 4. Setup for dom testing library.html
  • 5. Flexible unit test for heading using role and getByRole
  • 6. Flexible unit test for heading using role and getByRole.html
  • 7. Use setup.tc for an extended matcher like toBeInTheDocument
  • 8. Use setup.tc for an extended matcher.html
  • 9. Button role and getAllByRole for a flxible unit test
  • 10. Button role and getAllByRole for a flxible unit test.html
  • 11. userEvent , getByText and status role in unit test
  • 12. userEvent , getByText and status role in unit test.html
  • 13. Repalce sleep with smart wait using waitFor
  • 14. Repalce sleep with smart wait using waitFor.html
  • 15. Unit test for failure to appear in the UI after task has failed
  • 16. Unit test for failure to appear in the UI after task has failed.html
  • 17. Unit test for empty string to appear in the UI if task is not dispatched
  • 18. Unit test for empty string to appear in the UI.html
  • 19. Unit test with console.log and console.error
  • 20. Unit test with console.log and console.error.html
  • 21. Section summary
  • 22. Code at section end.html
  • 23. Coding Excercise 9
  • 24. Coding Excercise 9 - solution

  • 14. More requirements - code changes - unit test
  • 1. Section intro
  • 2. Section intro.html
  • 3. Add is scheduler started in logic and render to the UI
  • 4. Add is scheduler started in logic and render to the UI.html
  • 5. Update test to get 100% coverage
  • 6. Update the test to get 100% coverage.html
  • 7. Render queue length
  • 8. Render queue length.html
  • 9. Support async dispatch function
  • 10. Support async dispatch function.html
  • 11. Faketimer problem with async dispatch solved with flushPromises
  • 12. Faketimer problem with async dispatch.html
  • 13. Unit test of async dispatch functions add and getPosts
  • 14. Unit test of async dispatch functions add and getPosts.html
  • 15. Add enqueGetPosts in the UI + unit test + ad hoc vitest fix
  • 16. Add enqueGetPosts in the UI + unit test + ad hoc vitest fix.html
  • 17. Task overlapping problem
  • 18. Task overlapping problem.html
  • 19. Implement step by step a real timer test for task overlapping
  • 20. Implement step by step a real timer test for task overlapping.html
  • 21. Final task overlapping test + source code
  • 22. Final task overlapping test + source code.html
  • 23. Add action with result to the UI
  • 24. Add action with result to the UI.html
  • 25. Add try catch in dispatch
  • 26. Add try catch in dispatch.html
  • 27. Fix save on empty array for dequeue
  • 28. Fix save on empty array for dequeue.html
  • 29. Code at section end.html
  • 30. Coding Excercise 10
  • 31. Coding Excercise 10 - solution

  • 15. Advanced typescript for better code
  • 1. Section intro
  • 2. Section intro.html
  • 3. The problems with string as action type and possible solutions
  • 4. The problems with string as action type and possible solutions.html
  • 5. Union of strings as action type
  • 6. Union of strings as action type.html
  • 7. Enum as action type
  • 8. Enum as action type.html
  • 9. The problematics of working with type any
  • 10. The problematics of working with type any.html
  • 11. Use type unknown instead of type any
  • 12. Use type unknown instead of type any.html
  • 13. From unknown type to the correct type using validation
  • 14. From unknown type to the correct type using validation.html
  • 15. Unit test for code with unknown
  • 16. Unit test for code with unknown.html
  • 17. Motivation for generic task queue manager
  • 18. Motivation for generic task queue manager.html
  • 19. Design of generic storage using polymorphism , inheritance and interface
  • 20. Design of generic storage using polymorphism , inheritance and interface.html
  • 21. Implement Persist class and IPersistStorage interface
  • 22. Implement Persist class and IPersistStorage interface.html
  • 23. Implement class LocalStoragePersist and check with unit test
  • 24. Implement class LocalStoragePersist and check with unit test.html
  • 25. Refactor and use queue length getter
  • 26. Refactor and use queue length getter.html
  • 27. Code at section end.html
  • 28. Coding Excercise 11
  • 29. Coding Excercise 11 - solution

  • 16. React UI Unit testing with react testing library - RTL
  • 1. Section intro
  • 2. Download react ui and invoke vanilla or react ui
  • 3. Download react ui and invoke vanilla or react ui.html
  • 4. Tools to test react applications - mostly RTL
  • 5. Tools to test react applications - mostly RTL.html
  • 6. Use jsdom to test that a text exists on react ui
  • 7. Use jsdom to test that a text exists on react ui.html
  • 8. Use the RTL to create the first react unit test
  • 9. Use the RTL to create the first react unit test.html
  • 10. More unit tests using the RTL
  • 11. More unit tests using the RTL.html
  • 12. Unit test with document and RTL
  • 13. Unit test with document and RTL.html
  • 14. Complete the remaining tests using the RTL
  • 15. Complete the remaining tests using the RTL.html
  • 16. Fix react bug using unit test
  • 17. Fix react bug using unit test.html
  • 18. Use code coverage to remove unused code
  • 19. Use code coverage to remove unused code.html
  • 20. Section summary
  • 21. Code at section end.html
  • 22. Coding Excercise 12
  • 23. Coding Excercise 12 - solution

  • 17. Unit tests with Jest
  • 1. Section intro
  • 2. What is jest and its API relation with vitest
  • 3. What is jest and its API relation with vitest.html
  • 4. Create jest setup
  • 5. Create jest setup.html
  • 6. Add watch mode
  • 7. Add watch mode.html
  • 8. Add coverage test
  • 9. Add coverage test.html
  • 10. Configure vitest to handle only the test directory
  • 11. Configure vitest to handle only the test directory.html
  • 12. Tweak tests with jest to compile
  • 13. Tweak tests with jest to compile.html
  • 14. Fix test with jest add jsdom to jest.config.ts
  • 15. Fix test with jest add jsdom to jest.config.ts.html
  • 16. Fix test with jest add matchers
  • 17. Fix test with jest add matchers.html
  • 18. Fix test with jest regarding toContain
  • 19. Fix test with jest regarding toContain.html
  • 20. Fix test with jest dayjs problem - add esModuleInterop true in tsconfig.js
  • 21. Fix test with jest dayjs problem.html
  • 22. Fix test with jest persist mock problems -- add clearMocks and replace mock()
  • 23. Fix test with jest persist mock problems.html
  • 24. Use testMatch in jest.config.ts for better test file filtering
  • 25. Use testMatch in jest.config.ts for better test file filtering.html
  • 26. Fix test with jest problem with fetch -- replace with axios in src
  • 27. Fix test with jest problem with fetch.html
  • 28. Build the comparison between jest and vitest
  • 29. Build the comparison between jest and vitest.html
  • 30. Summary of the comparison between jest and vitest
  • 31. Code at section end.html
  • 32. Coding Excercise 13
  • 33. Coding Excercise 13 - solution

  • 18. Where to go from here
  • 1. Here we are - course summary
  • 2. Where to go from here - task queue manager
  • 3. Where to go from here - testing
  • 139,000 تومان
    بیش از یک محصول به صورت دانلودی میخواهید؟ محصول را به سبد خرید اضافه کنید.
    خرید دانلودی فوری

    در این روش نیاز به افزودن محصول به سبد خرید و تکمیل اطلاعات نیست و شما پس از وارد کردن ایمیل خود و طی کردن مراحل پرداخت لینک های دریافت محصولات را در ایمیل خود دریافت خواهید کرد.

    ایمیل شما:
    تولید کننده:
    مدرس:
    شناسه: 25526
    حجم: 6596 مگابایت
    مدت زمان: 769 دقیقه
    تاریخ انتشار: 21 آذر 1402
    طراحی سایت و خدمات سئو

    139,000 تومان
    افزودن به سبد خرید