HEX
Server: nginx/1.24.0
System: Linux nowruzgan 6.8.0-57-generic #59-Ubuntu SMP PREEMPT_DYNAMIC Sat Mar 15 17:40:59 UTC 2025 x86_64
User: babak (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/dev/nowruzgan/rest/node_modules/machinepack-mysql/test/connectable/create-manager.test.js
var assert = require('assert');
var Pack = require('../../');

describe('Connectable ::', function() {
  describe('Create Manager', function() {
    it('should work without a protocol in the connection string', function(done) {
      Pack.createManager({
        connectionString: 'localhost:3306/mppg'
      })
      .exec(function(err) {
        if (err) {
          return done(err);
        }
        return done();
      });
    });

    it('should successfully return a Pool', function(done) {
      Pack.createManager({
        connectionString: 'mysql://mp:mp@localhost:3306/mppg'
      })
      .exec(function(err, report) {
        if (err) {
          return done(err);
        }

        // Assert that the manager has a pool object
        assert(report.manager.pool);

        // Assert that the manager has a getConnection function
        assert(report.manager.pool.getConnection);

        return done();
      });
    });
  });
});