beforeEach(done => { try { Parse.User.enableUnsafeCurrentUser(); } catch (error) { if (error !== 'You need to call Parse.initialize before using Parse.') { throw error; } } TestUtils.destroyAllDataPermanently(true) .catch(error => { // For tests that connect to their own mongo, there won't be any data to delete. if ( error.message === 'ns not found' || error.message.startsWith('connect ECONNREFUSED') ) { return; } else { fail(error); return; } }) .then(reconfigureServer) .then(() => { Parse.initialize('test', 'test', 'test'); Parse.serverURL = 'http://localhost:' + port + '/1'; done(); }) .catch(done.fail); });
expect(res.master_key).toEqual('master'); appId = res.application_id; Parse.initialize(appId, 'unused'); const obj = new Parse.Object('TestObject'); obj.set('foo', 'bar');