From 36296ef688fe0ee2ba95c69589d162a109fdfaa1 Mon Sep 17 00:00:00 2001 From: Drew Gross Date: Tue, 17 May 2016 19:40:49 -0700 Subject: [PATCH] [WIP] we don't need to destroy all data both before starting a test AND after finishing it... --- spec/helper.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/spec/helper.js b/spec/helper.js index aa63ff0f4d..34e769f22b 100644 --- a/spec/helper.js +++ b/spec/helper.js @@ -85,7 +85,9 @@ beforeEach(function(done) { Parse.initialize('test', 'test', 'test'); Parse.serverURL = 'http://localhost:' + port + '/1'; Parse.User.enableUnsafeCurrentUser(); - return TestUtils.destroyAllDataPermanently().then(done, fail); + + return Parse.User.logOut() + .then(() => TestUtils.destroyAllDataPermanently().then(done, fail)); }); var mongoAdapter = new MongoStorageAdapter({ @@ -96,7 +98,7 @@ var mongoAdapter = new MongoStorageAdapter({ afterEach(function(done) { mongoAdapter.getAllSchemas() .then(allSchemas => { - allSchemas.forEach((schema) => { + allSchemas.forEach(schema => { var className = schema.className; expect(className).toEqual({ asymmetricMatch: className => { if (!className.startsWith('_')) { @@ -108,14 +110,6 @@ afterEach(function(done) { } }}); }); - }) - .then(() => Parse.User.logOut()) - .then(() => { - return TestUtils.destroyAllDataPermanently(); - }).then(() => { - done(); - }, (error) => { - console.log('error in clearData', error); done(); }); });