vendredi 28 août 2015

sails test controller not executing completely

I am using sailsjs v0.11

As mentioned in testing documentation, I have configured my app.

My UserController.test.js

var request = require('supertest');
console.log('log 1');
describe('UserController', function() {
  console.log('log 2');
  describe('index', function() {
    console.log('log 3');
    it('should return success', function(done) {
      console.log('log 4');
      request(sails.hooks.http.app)
        .get('/user')
        .expect(200, done);
    });
  });

});

If i execute PORT=9999 mocha test/bootstrap.test.js test/unit/**/*.test.js I can see only

log1
log2
log3

in my console. The code after console.log(log3) is not being executed. However My User.test.js in models is working fine.

What is the reason for that?

Aucun commentaire:

Enregistrer un commentaire