June 2016
Intermediate to advanced
910 pages
18h 59m
English
First, let's install the Jest command-line interface (Jest CLI):
npm install –-save-dev jest-cli
This command installs the Jest CLI, and adds it as a development dependency to our ~/snapterest/package.json file. Next, let's edit the package.json file. We'll replace the existing "script" object:
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},Replace the preceding object with the following one:
"scripts": {
"test": "jest"
},Now we're ready to run our test suit. Navigate to the ~/snapterest/ directory, and run the following command:
npm test
You should see the following message in your Terminal:
Using Jest CLI v0.4.18 PASS source/utils/__tests__/TweetUtils-test.js (0.065s) 1 test passed (1 total)
Read now
Unlock full access