Home - coursehero/ch-react-workshop GitHub Wiki
🔥 Oh no! Our website is broken again! 🔥
We wanted confidence that our software is reliable. Come to our workshop to learn how we added test coverage to the legacy as well as modern parts of our website.
HTML5, modern JavaScript. No experience with testing required. Knowledge of TypeScript welcome but optional.
For Cypress, knowledge of jQuery is highly recommended.
What is Course Hero?
Course Hero (CH) is a crowdsourced learning platform that contains class notes, study guides, practice problems, user submitted questions with answers from our tutors and original materials uploaded by educators. Users can either buy a subscription or upload their original documents to receive unlocks that can be used to download full CH documents. |
CH App
For our workshop we have implemented a simplified version of our document library that contains several fake documents. The front page features a search box with an autocomplete dropdown that lets you select a document and redirects to a page we call a DocumentLanding. On this page you can see information about document you found such as the school and course it belongs to on the top, a list of related documents on the left and a partially shown document in the middle of the page - if you want to unlock the full version, you will have to sign up for our service. |
From a technical standpoint this website is a mix of legacy and modern technologies, resembling the non-ideal situation of most codebases that have been around for a while. On the backend we have a legacy Node/Express (alternatively also a Python/Flask) server responsible for the few endpoints our frontend needs ( |
Learning outcomes
Our goal for this workshop is to take this legacy website that often breaks in production and to add tests to it. Some of the technologies we will use are Testing Library (DOM, React and Cypress Testing Library), Cypress, TypeScript, msw and aXe. |
There are different schools of thought. Here is some recommended reading.
|
Let's focus on the things that provide best return on investment. Here are the steps we recommend to add test coverage to a project.
TypeScript does have a steep learning curve but it is well worth it as it will eliminate an entire category of bugs.
This will cover the most important user flow of your app. In our workshop we will create a Cypress test that visits the frontpage, searches for a document, gets redirected to the DocumentLanding page and checks out a few related documents.
Additionally, we will consider other topics such as accessibility, mocking, test driven development and so on. |
- Testing Principles
- Introduction to Testing
- Introduction to Accessibility
- Introduction to Testing Library
- Introduction to Cypress
- Guide to Mocking
- Test Driven Development
- Add a comprehensive test coverage for the CH App.
- Master the TypeScript language.
- Take the Testing JavaScript class for a deeper dive into the world of automated testing!