Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Latest commit

 

History

History
48 lines (33 loc) · 1.41 KB

DevEnvSetup.md

File metadata and controls

48 lines (33 loc) · 1.41 KB

Setting up development environment

Prerequisites

Install the latest Node.js Long Term Support (LTS) version. An easy way to do that is through Node Version Manager, which allows you to install and switch between multiple Node.js versions:

nvm install 'lts/*'       # install the latest LTS version
nvm alias default 'lts/*' # default version to use for new shells
nvm use default           # switch to the default version
node -v                   # print the current Node.js version

Install Yarn package manager for Node.js (latest stable version). If you'd like to install Yarn manually, download yarn-<VERSION>.tar.gz tarball from their releases, extract it and add $YARN_HOME/bin directory to your PATH.

Project setup

Install or update project's dependencies with Yarn:

yarn install

Cosmos

Start Cosmos server used for testing React components an in isolated environment which simulates the consuming application:

yarn cosmos

Cosmos will watch the src directory for changes and rebuild its playground UI accordingly.

Jest

Start Jest in watch mode for executing tests:

yarn test:watch

Jest will watch all files ending with .test.js and rerun the corresponding tests.