bredikhin / sailsjs-mocha-testing-barrels-fixtures-example

An example of Sails.js-project testing with Mocha and Barrels for fixtures
121 stars 22 forks source link

Routing #7

Open fokkerone opened 8 years ago

fokkerone commented 8 years ago

All my Routes defined in config/routes always fail if i test with wallaby in Atom. If i run the same tests from terminal everything works as expected.

Even lift Sails from freeport with my routes won´t work var Barrels = require('barrels'); var routes = require('./config/routes');

  freeport(function (err, port) {
    if (err) throw err;

    // Lift Sails with test database
    global.sails = Sails.lift({
      log: {
        level: 'info'
      },
      models: {
        connection: 'test',
        migrate: 'drop'
      },
      routes: routes,
      port: port
    }, function (err) {
      if (err) {
        if (err) throw err;
        wallaby.start();
      }

      // Load fixtures
      var barrels = new Barrels();

      // Save original objects in `fixtures` variable
      fixtures = barrels.data;

      // Populate the DB
      barrels.populate(function (err) {
        if (err) throw err;
        wallaby.start();
      });
    });
  });
ArtemGovorov commented 8 years ago

Could you please create a sample repo with some failing tests so I could have a look? All tests in this repository are running ok with wallaby. Maybe also try this configuration file, either way let me know how it goes.