diff --git a/test/functional/collections.test.js b/test/functional/collections.test.js index 00a87f97df4..e3c7b27ecf3 100644 --- a/test/functional/collections.test.js +++ b/test/functional/collections.test.js @@ -13,38 +13,33 @@ describe('#collections', function() { let app = null; let client = null; - before(function() { - return launchCompass().then(function(application) { - app = application; - client = application.client; - client.connectToCompass({ hostname: 'localhost', port: 27018 }); + const dataService = new DataService(CONNECTION); + before(function(done) { + dataService.connect(function() { + dataService.createCollection('music.artists', {}, function() { + done(); + }); }); }); - after(function() { - return quitCompass(app); + after(function(done) { + dataService.dropDatabase('music', function() { + dataService.disconnect(); + done(); + }); }); context('when creating & deleting collections', function() { - const dataService = new DataService(CONNECTION); - - before(function(done) { - dataService.connect(function() { - dataService.createCollection('music.artists', {}, function() { - return client - .clickInstanceRefreshIcon() - .waitForInstanceRefresh().then(function() { - done(); - }); - }); + before(function() { + return launchCompass().then(function(application) { + app = application; + client = application.client; + client.connectToCompass({ hostname: 'localhost', port: 27018 }); }); }); - after(function(done) { - dataService.dropDatabase('music', function() { - dataService.disconnect(); - done(); - }); + after(function() { + return quitCompass(app); }); context('when viewing the database', function() {