Sails unit test with sails-hook-sequelize
<p>I am using <a href="https://www.npmjs.com/package/sails-hook-sequelize" rel="nofollow">sails-sequelize-hook</a> within my <a href="http://sailsjs.org/" rel="nofollow">sails</a> app. I am following <a href="http://sailsjs.org/documentation/concepts/testing" rel="nofollow">this</a> documentation to write my first controller unit test for my app. My <code>bootstrap.test.js</code> looks like this.</p>

<pre><code>var sails = require('sails');

before(function(done) {

    // Increase the Mocha timeout so that Sails has enough time to lift.
    this.timeout(5000);

    sails.lift({
    }, function(err, server) {
        if (err) return done(err);
        // here you can load fixtures, etc.
        done(err, sails);
    });
});

after(function(done) {
    // here you can clear fixtures, etc.
    sails.lower(done);
});
</code></pre>

<p>My connections is as follows</p>

<pre><code>module.exports.connections = {

    dbTest: {
        user: 'root',
        password: 'root',
        database: 'myappdb',
        options: {
            host: 'localhost',
            dialect: 'mysql',
            pool: {
                max: 5,
                min: 0,
                idle: 10000
            }
        }
    },
}
</code></pre>

<p>When I run <code>npm test</code> I get the following error</p>

<pre><code>error: In model (myfirstmodel), invalid connection :: { user: 'root',
  password: 'root',
  database: 'myappdb',
  options: 
   { host: 'localhost',
     dialect: 'mysql',
     pool: { max: 5, min: 0, idle: 10000 },
     logging: [Function: _writeLogToConsole] } }
error: Must contain an `adapter` key referencing the adapter to use.
npm ERR! Test failed.  See above for more details.
</code></pre>

<p>What am I missing here? What adapter name do I give? I think I'm lost.</p>