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

JavaScript JavaScript Unit Testing Behavior Driven Development with Mocha & Chai Test Suites and Test Specs (describe and it)

error running npm test

when I run npm test, I get:

> battleship@1.0.0 test
> echo "Error: no test specified"

"Error: no test specified"

this is my main_test file:

var expect = require('chai').expect;

// test suite
describe('Mocha', function (){
    // test spec (unit test)
    it('should run our tests using npm', function(){
        expect(true).to.be.ok;
    });
});

this is NOT what the instructor gets. what m I missing?

1 Answer

you can try to change your script in package.json to:

"scripts": { "test": "mocha" },

this worked for me