Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Ary de Oliveira
Courses Plus Student 28,304 PointsUse mocha to automatically run all the tests in tests.js.
Use mocha to automatically run all the tests in tests.js.
I can not find the appropriate command to run this test ?
7 Answers
Seth Kroger
56,416 Pointsmocha will run the tests in the specified file or directory that follows it, so the answer should be "mocha tests.js"
Ary de Oliveira
Courses Plus Student 28,304 PointsRight answer
mocha tests.js
David Soto
7,581 PointsTest is plural so check your typing, I took me a bit to realize it's "tests" not "test"
Ary de Oliveira
Courses Plus Student 28,304 Pointsok
Mitul Patel
24,890 PointsYou could automate it. Here's how:
-
In your ~/.bash_profile
alias automocha="supervisor -q -n exit -x mocha -- -b" -
install mocha & supervisor globally(optional - you can just install them locally to your project as devDependencies)
$ npm install -g supervisor mocha
when you run automocha on your project. It will automatically invoke mocha every time a file changes.
archiebolt makumbi
7,073 Pointsmocha tests.js
Rhonda Green
11,708 PointsThis worked for me
mocha -g tests.js
Seth Kroger
56,416 PointsSeth Kroger
56,416 PointsI've tested it and the challenge accepts what I wrote. (without quote marks, of course)