Getting Started
Getting Started
Welcome to Detox!
In this guide, we will walk you through setting Detox up in your project, one step at a time.
You will find that some steps are longer than the others: some are just one-paragraph long, while for others we have a dedicated multistep guide worked out. Bear with us - it is all necessary, and once set-up, it is easy to move forward with writing tests very rapidly.
Step 1: Environment Setup
Install Node.js
Node.js is the JavaScript runtime Detox will run on. Install Node.js v12.0 or above.
There’s more than one way to install Node.js:
- Download from the official download page
- Use Homebrew
- Use
nvm- if you need to allow for several versions to be installed on a single machine
The simplest way is to use Homebrew:
brew install node
Tip: Verify installation succeeded by typing in
node -vin the terminal to output current node version.
Install Detox Command Line Tools (detox-cli)
This package makes it easier to operate Detox from the command line. detox-cli should be installed globally, enabling usage of the command line tools outside your npm scripts. detox-cli is merely a script that passes commands through to a command line tool shipped inside detox package (in node_modules/.bin/detox).
- npm
- Yarn
- pnpm
npm install detox-cli --global
yarn global add detox-cli
pnpm add detox-cli --global
<