Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions integration/server.js

This file was deleted.

12 changes: 11 additions & 1 deletion integration/test/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
"env": {
"jasmine": true
},
"globals": {},
"globals": {
"Child": true,
"Container": true,
"DiffObject": true,
"Item": true,
"Parse": true,
"Parent": true,
"reconfigureServer": true,
"TestObject": true,
"TestPoint": true
},
"rules": {
"no-console": [0],
"no-var": "error"
Expand Down
10 changes: 1 addition & 9 deletions integration/test/ArrayOperationsTest.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
'use strict';

const assert = require('assert');
const clear = require('./clear');
const Parse = require('../../node');

describe('Array Operations', () => {
beforeAll(done => {
Parse.initialize('integration');
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
Parse.Storage._clear();
clear().then(done).catch(done.fail);
});

it('initializes a field', done => {
const object = new Parse.Object('TestObject');
object.set('strings', ['foo', 'bar', 'baz']);
Expand Down Expand Up @@ -375,7 +367,7 @@ describe('Array Operations', () => {
});
});

it('fails when combining remove with add unique', done => {
it('fails when combining addUnique with remove', done => {
const object = new Parse.Object('TestObject');
object.set('strings', ['foo', 'bar']);
object
Expand Down
16 changes: 0 additions & 16 deletions integration/test/DirtyTest.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
'use strict';

const assert = require('assert');
const clear = require('./clear');
const Parse = require('../../node');

const TestObject = Parse.Object.extend('TestObject');
const Parent = Parse.Object.extend('Parent');
const Child = Parse.Object.extend('Child');

describe('Dirty Objects', () => {
beforeEach(done => {
Parse.initialize('integration');
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
Parse.Storage._clear();
clear()
.then(() => {
done();
})
.catch(done.fail);
});

it('tracks dirty arrays', done => {
const array = [1];
const object = new TestObject();
Expand Down
9 changes: 1 addition & 8 deletions integration/test/IdempotencyTest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

const clear = require('./clear');
const Parse = require('../../node');

const Item = Parse.Object.extend('IdempotencyItem');
Expand All @@ -21,14 +20,8 @@ function DuplicateXHR(requestId) {
}

describe('Idempotency', () => {
beforeEach(done => {
Parse.initialize('integration', null, 'notsosecret');
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
Parse.Storage._clear();
beforeEach(() => {
RESTController._setXHR(XHR);
clear().then(() => {
done();
});
});

it('handle duplicate cloud code function request', async () => {
Expand Down
14 changes: 0 additions & 14 deletions integration/test/IncrementTest.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
'use strict';

const assert = require('assert');
const clear = require('./clear');
const Parse = require('../../node');

const TestObject = Parse.Object.extend('TestObject');

describe('Increment', () => {
beforeEach(done => {
Parse.initialize('integration');
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
Parse.Storage._clear();
clear()
.then(() => {
done();
})
.catch(done.fail);
});

it('can increment a field', done => {
const object = new TestObject();
object.set('score', 1);
Expand Down
30 changes: 6 additions & 24 deletions integration/test/ParseACLTest.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
'use strict';

const assert = require('assert');
const clear = require('./clear');
const Parse = require('../../node');

const TestObject = Parse.Object.extend('TestObject');

describe('Parse.ACL', () => {
beforeEach(done => {
Parse.initialize('integration');
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
Parse.Storage._clear();
beforeEach(() => {
Parse.User.enableUnsafeCurrentUser();
clear()
.then(() => {
Parse.User.logOut().then(
() => {
done();
},
() => {
done();
}
);
})
.catch(done.fail);
});

it('acl must be valid', () => {
Expand Down Expand Up @@ -61,7 +43,7 @@ describe('Parse.ACL', () => {
assert.equal(object.getACL().getPublicReadAccess(), false);
assert.equal(object.getACL().getPublicWriteAccess(), false);

await await Parse.User.logOut();
await Parse.User.logOut();
try {
const query = new Parse.Query(TestObject);
await query.get(object.id);
Expand Down Expand Up @@ -214,7 +196,7 @@ describe('Parse.ACL', () => {
object.getACL().setPublicReadAccess(true);
await object.save();

Parse.User.logOut();
await Parse.User.logOut();
const o = await new Parse.Query(TestObject).get(object.id);
assert(o);
});
Expand All @@ -232,7 +214,7 @@ describe('Parse.ACL', () => {
object.getACL().setPublicReadAccess(true);
await object.save();

Parse.User.logOut();
await Parse.User.logOut();
const o = await new Parse.Query('AlsoUniqueObject').find();

assert(o.length > 0);
Expand All @@ -251,7 +233,7 @@ describe('Parse.ACL', () => {
object.getACL().setPublicReadAccess(true);
await object.save();

Parse.User.logOut();
await Parse.User.logOut();
object.set('score', 10);
try {
await object.save();
Expand All @@ -273,7 +255,7 @@ describe('Parse.ACL', () => {
object.getACL().setPublicReadAccess(true);
await object.save();

Parse.User.logOut();
await Parse.User.logOut();
try {
await object.destroy();
} catch (e) {
Expand Down
15 changes: 0 additions & 15 deletions integration/test/ParseCloudTest.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
'use strict';

const assert = require('assert');
const clear = require('./clear');
const Parse = require('../../node');
const sleep = require('./sleep');

describe('Parse Cloud', () => {
beforeAll(done => {
Parse.initialize('integration', null, 'notsosecret');
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
Parse.Storage._clear();
clear().then(
() => {
done();
},
() => {
done();
}
);
});

it('run function', done => {
const params = { key1: 'value2', key2: 'value1' };
Parse.Cloud.run('bar', params)
Expand Down
10 changes: 0 additions & 10 deletions integration/test/ParseConfigTest.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
'use strict';

const assert = require('assert');
const clear = require('./clear');
const Parse = require('../../node');

function testConfig() {
return Parse.Config.save({ internal: 'i', string: 's', number: 12 }, { internal: true });
}

describe('Parse Config', () => {
beforeEach(done => {
Parse.initialize('integration', null, 'notsosecret');
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
Parse.Storage._clear();
clear().then(() => {
done();
});
});

it('can create a config', async () => {
const config = await testConfig();

Expand Down
8 changes: 0 additions & 8 deletions integration/test/ParseFileTest.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
'use strict';

const assert = require('assert');
const clear = require('./clear');
const Parse = require('../../node');

describe('Parse.File', () => {
beforeEach(done => {
Parse.initialize('integration', null, 'notsosecret');
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
Parse.Storage._clear();
clear().then(done).catch(done.fail);
});

it('can save file with uri', async () => {
// Try https
const parseLogo =
Expand Down
11 changes: 0 additions & 11 deletions integration/test/ParseGeoBoxTest.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
'use strict';

const assert = require('assert');
const clear = require('./clear');
const Parse = require('../../node');

const southwestOfSF = new Parse.GeoPoint(37.708813, -122.526398);
const northeastOfSF = new Parse.GeoPoint(37.822802, -122.373962);

describe('Geo Box', () => {
beforeAll(() => {
Parse.initialize('integration');
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
Parse.Storage._clear();
});

beforeEach(done => {
clear().then(done).catch(done);
});

it('can query geo boxes', done => {
const caltrainStationLocation = new Parse.GeoPoint(37.776346, -122.394218);
const caltrainStation = new Parse.Object('Location');
Expand Down
Loading