- Clone this repo to your local device
cd
into the repo directory- Run
npm install
(only for the first time you run the app) - Run
npm start
- First, push to the
master
branch (this branch is the one that's connected to our staging environment):- Make your changes on the
master
branch - Lint your code by running
npm run lint:fix
and continue only if they pass - Run all tests and continue only if they pass
git add [your changed files]
git commit -m "[Card #][Your name] Your commit message
git pull --rebase
- Run all tests and continue only if they pass
git push
- Make your changes on the
- Second, push to the
release
branch (this branch is the one that's connected to our production environment):git checkout release
git merge master
git push
- Checkout to the
master
branch again (git checkout master
) and check the CI pipeline builds - If the build passes, you're done!
- If the build fails, click the link highlighted below to read the errors, fix the issue, and commit/push the fix by following the instructions above
- Jest and Enzyme, ie. unit/component tests
- Run
npm test
to launch the tests in watch mode - Type
a
to run all tests
- Run
- Cypress, ie. end-to-end (E2E) tests
- Run
npm install
(only for the first time you run the E2E tests) - Run
npm start
to run the app so that Cypress can access it at localhost:3000 - In a different terminal tab/window, run
npm run cypress
to launch the Cypress app and click the▶️ Run all specs
button - To run the E2E tests in the terminal without running the Cypress app, skip steps #2 and #3, and run
npm run cypress:headless
- Run
- Packages are managed using yarn
- To install a new package, use
yarn add package-name
- To make sure all pagages are installed locally, run
yarn install
When code is pushed to the master
branch, you can view that code at our staging environment, hosted via Surge.
🔖_Bookmark me —_ The URL is in our team tech docs
When code is pushed to the release
branch, you can view that code at our production environment, hosted via GitHub Pages.
🔖_Bookmark me —_ https://thoughtworksarts.io/a-fathers-lullaby
Both environments run through our CI pipeline via TravisCI, so for both environments, you can view pushed code only if all of the tests pass in the pipeline. You can view our pipeline here: https://travis-ci.org/thoughtworksarts/a-fathers-lullaby/builds