All of the code for this application can be found in the redux-shopping-cart github repo, specifically in the testing
branch. An explanation for how it was built can be found by completing the Modern Redux with RTK and TypeScript course on egghead.
To quickly summarize a few of the things you need to know to be successful:
This app is built with Redux Toolkit which has a slightly different syntax than standard Redux, however the testing examples should all work seamlessly in any Redux application
The app is built on top of vite instead of the more popular create react app. The benefit of vite is that it installs and builds extremely quickly. One of the downsides of vite is that it doesn't come with any out-of-the-box testing support. It also has its own esbuild-based compiler, which is not currently compatible with jest, so we have to configure JSX & TypeScript support for jest even though vite
handles it already.
Almost all of the key files for the project are found in the src/features
folder. "Slice" files are a Redux Toolkit convention and they contain all the redux code for that part of the application.
You can get the app started by typing npm run dev
and opening your browser to http://localhost:3000/.