drop.js 858 B

123456789101112131415161718192021222324252627282930313233343536
  1. var assert = require('assert');
  2. var _ = require('@sailshq/lodash');
  3. var Adapter = require('../../../lib/adapter');
  4. var Support = require('../../support/bootstrap');
  5. describe('Unit Tests ::', function() {
  6. describe('Drop', function() {
  7. // Test Setup
  8. before(function(done) {
  9. Support.Setup('test_drop', done);
  10. });
  11. after(function(done) {
  12. Support.Teardown('test_drop', done);
  13. });
  14. it('should remove a table from the database', function(done) {
  15. Adapter.drop('test', 'test_drop', [], function dropCb(err) {
  16. if (err) {
  17. return done(err);
  18. }
  19. Adapter.describe('test', 'test_drop', function describeCb(err, result) {
  20. if (err) {
  21. return done(err);
  22. }
  23. assert.equal(_.keys(result), 0);
  24. return done();
  25. });
  26. });
  27. });
  28. });
  29. });