Module 0: Setup
This module will help you set up your local environment!
There are 2 reasons you'll need git -
- To clone this repository.
- Jest, the test framework we're going to use, depends on git to identify changes you've recently made.
If you already have a git client installed, you're covered for #1.
For #2, you'll need to make sure you can access git from a terminal/command line.
If you have git installed, and accessible to your terminal, you'll see a version number listed. You can move on to 2. NodeJS!
If you don't see a version listed, or an error that says something to the effect of "I don't know what git is", you need to either install git, or add it to your path/environment variables.
I need to install git
I already installed git but
git -v doesn't work
This probably means git wasn't added to your path/environment variables, so your terminal can't find it. You have a couple options.
Option 2 is a little more complicated. If you don't know how to do it already, you'll likely need to search the internet to find out how.
You should see a version number, and the version number should be at least 8.9.0.
I see a version number, and it is at least 8.9.0!
I see a version number, but it is less than 8.9.0.
There's a chance that things could be fine, but you might want to upgrade your version of Node just to be safe.
nvm install v8.9.4.
I don't see a version number.
I recommend using a Node version manager - this will allow you to install multiple versions of Node locally, and switch between them. This is especially helpful if you're attending multiple workshops, as different sessions might require different versions. If you're on Mac/Linux, I recommend NVM. If you're on Windows, I recommend nvm-windows.
If you'd prefer to just install one version of Node, that's fine too. You can grab the LTS installer from NodeJS.org.
You should see a version number, and the version number should be at least 5.5.1.
I see a version number, and the version number is at least 5.5.1!
I see a version number, but it is less than 5.5.1.
I don't see a version number.
Clone This Repository
The repository URL is https://github.com/pepopowitz/tdd-workshop.git. If you've never done this before, you want to go into your terminal and type...
git clone https://github.com/pepopowitz/tdd-workshop.git
This will clone the repository into your current working directory.
I've included a simple test to make sure everything seems to be installed correctly.
npm run verify.
You should see the below output. If you do, you're ready to go! If you don't, ask your neighbor or the instructor for help, or create an issue in this repository describing the problem.
Dependencies are set up! PASS module-0 module-0/verify.spec.js Verifying your setup ✓ should run a test (3ms) Test Suites: 1 passed, 1 total Tests: 1 passed, 1 total Snapshots: 0 total Time: 0.859s, estimated 1s Ran all test suites. Watch Usage › Press f to run only failed tests. › Press o to only run tests related to changed files. › Press p to filter by a filename regex pattern. › Press t to filter by a test name regex pattern. › Press q to quit watch mode. › Press Enter to trigger a test run.
q to quit the verification step.
watchman error on Mac
If you see an error referencing
watchman, and you are on a Mac, you might need to manually install watchman. Do this with homebrew (brew install watchman).
Even after installing, sometimes it seems to fail at linking. You might need to do this manually, too (
brew link watchman).
A possibly related issue is here - https://github.com/expo/expo/issues/854.