Warren
Warren

Reputation: 755

Sails.js testing with mocha only runs one test not two

I followed the sails.js testing example at http://sailsjs.org/#!/documentation/concepts/Testing . I have got it to run, but it only runs one test. The command line in package.json script.test is:

mocha test/bootstrap.test.js test/unit/**/*.test.js

"test/unit/**/*.test.js" should be catching 2 tests, UsersControllers.test.js and Users.test.js . It is only running Users.test.js . And yes, both tests are in the test/unit/ directory.

CLI Screen Shot

What am I doing wrong here ?

Upvotes: 4

Views: 199

Answers (1)

Ovi
Ovi

Reputation: 604

After copying the documented test cases from the sails js docs, make sure to change the following line in the User.test.js file

describe.only('UsersModel', function() {

to

describe('UsersModel', function() {

then you should see the controller test as well.

Upvotes: 2

Related Questions