https://github.com/m0hanraj/social-comments
Simple react app to render comments with React Testing Library based tests
https://github.com/m0hanraj/social-comments
jest react react-testing-library reactjs tdd tdd-javascript
Last synced: 2 months ago
JSON representation
Simple react app to render comments with React Testing Library based tests
- Host: GitHub
- URL: https://github.com/m0hanraj/social-comments
- Owner: m0hanraj
- Created: 2022-03-04T11:49:23.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-04T15:48:39.000Z (over 3 years ago)
- Last Synced: 2025-04-12T23:56:56.246Z (2 months ago)
- Topics: jest, react, react-testing-library, reactjs, tdd, tdd-javascript
- Language: JavaScript
- Homepage:
- Size: 287 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TDD with React Testing library
This repo contains a sample code for [TDD with React Testing Library](https://www.mohanraj.dev/blogs/tdd-with-react-testing-library-component-testing) blog.
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode. Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
### `npm test`
Launches the test runner in the interactive watch mode and runs the tests that are set up using React Testing Library.
### `npm run build`
Builds the app for production to the `build` folder. It correctly bundles React in production mode and optimizes the build for the best performance.
## Static API
The project uses static API to simulate the remote API back-end. I have used `json-server` to fake the API's and it reads data from `db.json`.
To run this service you need to install json-server using
### `npm install -g json-server`
Run below command from this repo to start the service
### `json-server -p 4000 --watch db.json`