https://github.com/capjavert/react-cms-tdd-example
Example of tests setup for general CMS with react-admin, jest and testcafe
https://github.com/capjavert/react-cms-tdd-example
cms jest react react-admin test testcafe
Last synced: 7 months ago
JSON representation
Example of tests setup for general CMS with react-admin, jest and testcafe
- Host: GitHub
- URL: https://github.com/capjavert/react-cms-tdd-example
- Owner: capJavert
- Created: 2019-07-15T08:50:52.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-12T23:59:13.000Z (over 3 years ago)
- Last Synced: 2025-03-24T08:31:26.256Z (about 1 year ago)
- Topics: cms, jest, react, react-admin, test, testcafe
- Language: JavaScript
- Size: 5.53 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React CMS TDD example
[](https://travis-ci.org/capJavert/react-cms-tdd-example)
Example of tests setup for general CMS with react-admin, jest, enzyme and testcafe.
## Setup
```
npm install
```
## Available Scripts
In the project directory, you can run following commands.
### Start
```
npm start
```
Runs the app in the development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
### Fake REST
```
npm run fake:rest
```
Run json-server on [localhost:4444](http://localhost:444) and using `./data/db.json` as data source.
### Test
```
npm test
```
Launches the test runner in the interactive watch mode.
```
npm run e2e
```
Executes e2e tests with testcafe.
Be sure to start dev server with `start` command or use `build -- --test` and `serve` commands for production code testing.
You can pass any option supported by [testcafe command](https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html).
**To learn more about tests and how to write them check `./TESTING.md` file.**
### Build
```
npm 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.
Options:
--test - **Include test attributes (used for e2e testing selectors)
**
The build is minified and the filenames include the hashes.
### Serve
```
npm serve
```
Serve created build from `./build` folder.
Open [http://localhost:3000](http://localhost:5000) to view it in the browser.
This command also starts json server like `fake:rest` command.
Options:
--no-json-server - **Do not start json server
**
--no-public - **Do not server `./build` folder
**