https://github.com/vaibhav1565/swiggy-clone
A Swiggy clone
https://github.com/vaibhav1565/swiggy-clone
akshay-saini babel-jest class-based-components cors jest lazy-loading namaste-react namaste-react-course parcel parcel-bundler react react-router-dom reduxjs swiggy swiggy-clone tailwind
Last synced: about 2 months ago
JSON representation
A Swiggy clone
- Host: GitHub
- URL: https://github.com/vaibhav1565/swiggy-clone
- Owner: vaibhav1565
- Created: 2025-01-29T14:17:26.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-03-22T12:21:48.000Z (about 2 months ago)
- Last Synced: 2025-03-22T13:22:12.631Z (about 2 months ago)
- Topics: akshay-saini, babel-jest, class-based-components, cors, jest, lazy-loading, namaste-react, namaste-react-course, parcel, parcel-bundler, react, react-router-dom, reduxjs, swiggy, swiggy-clone, tailwind
- Language: JavaScript
- Homepage: https://swiggy-clone-pearl.vercel.app
- Size: 13.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Food App
To run the app:
`npm start`To build the app:
`npm run build`To run the tests:
`npm run test`## App structure
- **Header**
- Logo
- Nav Items- **Body**
- Search
- RestaurantContainer
- RestaurantCard
- img
- Name of Restaurant, Star Rating, Cuisine, Delivery Time- **Footer**
- Copyright
- Links
- Address
- Contact## Steps involved in setting up testing in this app
1. Install React Testing Library
2. Install Jest
3. Install Jest dependency Babel
4. Configure Babel
5. Configure Parcel config file to disable default Babel transpilation
6. Jest - `npx jest --init`
7. Install jsdom library
8. Install `@babel/preset-react` to make JSX work in test cases
9. Include `@babel/preset-react` inside Babel configuration
- Add this to `babel.config.js`:
```javascript
['@babel/preset-react', { runtime: "automatic" }]
```
10. Install Jest DOM:
```sh
npm i -D @testing-library/jest-dom
```