Skip to content

Commit 21422f4

Browse files
committed
remove extra parse instance
1 parent 27992ad commit 21422f4

File tree

3 files changed

+8
-98
lines changed

3 files changed

+8
-98
lines changed

spec/ParseAPI.spec.js

+8-25
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,14 @@ const headers = {
2424
};
2525

2626
describe_only_db('mongo')('miscellaneous', () => {
27-
it('test rest_create_app', function (done) {
28-
let appId;
29-
Parse._request('POST', 'rest_create_app')
30-
.then(res => {
31-
expect(typeof res.application_id).toEqual('string');
32-
expect(res.master_key).toEqual('master');
33-
appId = res.application_id;
34-
Parse.initialize(appId, 'unused');
35-
const obj = new Parse.Object('TestObject');
36-
obj.set('foo', 'bar');
37-
return obj.save();
38-
})
39-
.then(() => {
40-
const config = Config.get(appId);
41-
return config.database.adapter.find('TestObject', { fields: {} }, {}, {});
42-
})
43-
.then(results => {
44-
expect(results.length).toEqual(1);
45-
expect(results[0]['foo']).toEqual('bar');
46-
done();
47-
})
48-
.catch(error => {
49-
fail(JSON.stringify(error));
50-
done();
51-
});
27+
it('db contains document after successful save', async () => {
28+
const obj = new Parse.Object('TestObject');
29+
obj.set('foo', 'bar');
30+
await obj.save();
31+
const config = Config.get(defaultConfiguration.appId);
32+
const results = await config.database.adapter.find('TestObject', { fields: {} }, {}, {});
33+
expect(results.length).toEqual(1);
34+
expect(results[0]['foo']).toEqual('bar');
5235
});
5336
});
5437

spec/helper.js

-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ const reconfigureServer = changedConfiguration => {
143143
});
144144
cache.clear();
145145
parseServer = ParseServer.start(newConfiguration);
146-
parseServer.app.use(require('./testing-routes').router);
147146
parseServer.expressApp.use('/1', err => {
148147
console.error(err);
149148
fail('should not call next');

spec/testing-routes.js

-72
This file was deleted.

0 commit comments

Comments
 (0)