https://github.com/sdtelectronics/cs397-react
https://github.com/sdtelectronics/cs397-react
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/sdtelectronics/cs397-react
- Owner: SdtElectronics
- License: mit
- Created: 2022-09-22T21:56:59.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-10T05:11:26.000Z (over 3 years ago)
- Last Synced: 2025-02-16T05:16:16.067Z (over 1 year ago)
- Language: JavaScript
- Size: 358 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React Vitest Template
A starter template for building React apps with Vite. Includes Vitest for unit testing and
a hefty .gitignore file.
## Usage
```
mkdir your-app-name
cd your-app-name
npx degit criesbeck/react-vitest
npm install
```
## Test
Verify that the initial app works. Run
```
npm start
```
and open the URL displayed.
Verify that the unit tests work with
```
npm test
```
Two tests should run and pass.
## Scripts
**package.json** defines the following scripts:
| Script | Description |
| -------------- | --------------------------------------------------- |
| npm start | Runs the app in the development mode. |
| npm run dev | Runs the app in the development mode. |
| npm run build | Builds the app for production to the `dist` folder. |
| npm run serve | Serves the production build from the `dist` folder. |
| npm test | Starts a Jest-like test loop |
## Git
If everything is working, set up [your local and remote repositories](https://docs.github.com/en/get-started/importing-your-projects-to-github/importing-source-code-to-github/adding-locally-hosted-code-to-github#adding-a-local-repository-to-github-using-git).
## Folder Structure
```
your-app-name
├── node_modules
├── public
│ ├── favicon.svg
│ └── robots.txt
└── src
├── App.css
├── App.jsx
├── index.css
├── index.jsx
└── logo.svg
├── .gitignore
├── index.html
├── package.json
├── README.md
├── vite.config.js
```
## Credits
React-Vitest built and maintained by [Chris Riesbeck](https://github.com/criesbeck).
Inspired by [SafdarJamal/vite-template-react](https://github.com/SafdarJamal/vite-template-react).
Expanded to include Vitest and some sample tests.
Thanks to Rich Harris for [degit](https://www.npmjs.com/package/degit).
Gitignore file created with [the Toptal tool](https://www.toptal.com/developers/gitignore/api/react,firebase,visualstudiocode,macos,windows).
## License
This project is licensed under the terms of the [MIT license](./LICENSE).