create-manager.test.js 950 B

12345678910111213141516171819202122232425262728293031323334353637
  1. var assert = require('assert');
  2. var Pack = require('../../');
  3. describe('Connectable ::', function() {
  4. describe('Create Manager', function() {
  5. it('should work without a protocol in the connection string', function(done) {
  6. Pack.createManager({
  7. connectionString: 'localhost:3306/mppg'
  8. })
  9. .exec(function(err) {
  10. if (err) {
  11. return done(err);
  12. }
  13. return done();
  14. });
  15. });
  16. it('should successfully return a Pool', function(done) {
  17. Pack.createManager({
  18. connectionString: 'mysql://mp:mp@localhost:3306/mppg'
  19. })
  20. .exec(function(err, report) {
  21. if (err) {
  22. return done(err);
  23. }
  24. // Assert that the manager has a pool object
  25. assert(report.manager.pool);
  26. // Assert that the manager has a getConnection function
  27. assert(report.manager.pool.getConnection);
  28. return done();
  29. });
  30. });
  31. });
  32. });