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
.
Install or update project's dependencies with Yarn:
yarn install
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.
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.