Skip to content

Commit e857418

Browse files
committed
No longer run mocha globally
* Create package.json with dependencies * Update npm test command * Update readme on how to run and install * Change mocha options
1 parent 507f43e commit e857418

File tree

4 files changed

+33
-3
lines changed

4 files changed

+33
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
.DS_Store

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ Let's practice using `map`, `filter`, and `reduce`!
88

99
#### Setup
1010

11-
1. Install [mocha](https://mochajs.org/): `npm install -g mocha`
12-
1. To run all the tests: `mocha .`
11+
1. `npm install`
12+
1. Run each set of tests with `npm test ./[path]`
13+
* For example: `npm test ./map`
1314

1415
#### Details
1516

package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "map-filter-reduce-exercises",
3+
"version": "1.0.0",
4+
"description": "Let's practice using `map`, `filter`, and `reduce`!",
5+
"directories": {
6+
"test": "test"
7+
},
8+
"scripts": {
9+
"test": "node_modules/.bin/mocha"
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/gSchool/map-filter-reduce-exercises.git"
14+
},
15+
"author": "Wes Reid",
16+
"license": "ISC",
17+
"bugs": {
18+
"url": "https://github.com/gSchool/map-filter-reduce-exercises/issues"
19+
},
20+
"homepage": "https://github.com/gSchool/map-filter-reduce-exercises#readme",
21+
"devDependencies": {
22+
"mocha": "^2.5.3"
23+
},
24+
"dependencies": {
25+
"tap": "^6.2.0"
26+
}
27+
}

test/mocha.opts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--recursive
1+
--reporter list

0 commit comments

Comments
 (0)