Skip to content

Commit b652c48

Browse files
authored
⚡️ Release v2.3.1 (#766)
* ⚡️ Release v2.3.1 Bump dev-dependencies * remove vendor folder * revert dev-dep * fix flaky tests * add #767 to changelog
1 parent 781026c commit b652c48

File tree

11 files changed

+252
-485
lines changed

11 files changed

+252
-485
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
## 2.3.1
77
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.3.0...2.3.1)
88

9+
- `_linkWith` and `_unlinkFrom` support MasterKey and SessionToken options ([#767](https://github.com/parse-community/Parse-SDK-JS/pull/767))
910
- Correct homepage in package.json ([#9e198b3](https://github.com/parse-community/Parse-SDK-JS/commit/9e198b368862925025737aa725e9a2e8b3d4205a))
1011
- Add Issues template for opening GitHub Issue ([#760](https://github.com/parse-community/Parse-SDK-JS/pull/760))
1112
- Add Public email address to satisfy an npmjs requirement ([#764](https://github.com/parse-community/Parse-SDK-JS/pull/764))

greenkeeper.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"default": {
44
"packages": [
55
"integration/package.json",
6-
"package.json",
7-
"vendor/babel-plugin-dead-code-elimination/package.json"
6+
"package.json"
87
]
98
}
109
}

integration/cloud/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Parse.Cloud.job('CloudJob2', function() {
3030
resolve({
3131
status: 'cloud job completed'
3232
})
33-
}, 3000);
33+
}, 1000);
3434
});
3535
});
3636

integration/test/ParseCloudTest.js

+11-7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const assert = require('assert');
44
const clear = require('./clear');
55
const Parse = require('../../node');
6+
const sleep = require('./sleep');
67

78
describe('Parse Cloud', () => {
89
beforeAll((done) => {
@@ -88,13 +89,16 @@ describe('Parse Cloud', () => {
8889
});
8990
});
9091

91-
it('run long job', (done) => {
92-
Parse.Cloud.startJob('CloudJob2').then((jobStatusId) => {
93-
return Parse.Cloud.getJobStatus(jobStatusId);
94-
}).then((jobStatus) => {
95-
assert.equal(jobStatus.get('status'), 'running');
96-
done();
97-
});
92+
it('run long job', async () => {
93+
const jobStatusId = await Parse.Cloud.startJob('CloudJob2');
94+
95+
let jobStatus = await Parse.Cloud.getJobStatus(jobStatusId);
96+
assert.equal(jobStatus.get('status'), 'running');
97+
98+
await sleep(2000);
99+
100+
jobStatus = await Parse.Cloud.getJobStatus(jobStatusId);
101+
assert.equal(jobStatus.get('status'), 'succeeded');
98102
});
99103

100104
it('run bad job', (done) => {

integration/test/ParseLiveQueryTest.js

+15-25
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const assert = require('assert');
44
const clear = require('./clear');
55
const Parse = require('../../node');
6+
const sleep = require('./sleep');
67

78
const TestObject = Parse.Object.extend('TestObject');
89
const DiffObject = Parse.Object.extend('DiffObject');
@@ -15,7 +16,7 @@ describe('Parse LiveQuery', () => {
1516
clear().then(done).catch(done.fail);
1617
});
1718

18-
it('can subscribe to query', async () => {
19+
it('can subscribe to query', async (done) => {
1920
const object = new TestObject();
2021
await object.save();
2122

@@ -25,12 +26,13 @@ describe('Parse LiveQuery', () => {
2526

2627
subscription.on('update', object => {
2728
assert.equal(object.get('foo'), 'bar');
29+
done();
2830
})
2931
object.set({ foo: 'bar' });
3032
await object.save();
3133
});
3234

33-
it('can subscribe to multiple queries', async (done) => {
35+
it('can subscribe to multiple queries', async () => {
3436
const objectA = new TestObject();
3537
const objectB = new TestObject();
3638
await Parse.Object.saveAll([objectA, objectB]);
@@ -52,14 +54,11 @@ describe('Parse LiveQuery', () => {
5254
})
5355
await objectA.save({ foo: 'bar' });
5456
await objectB.save({ foo: 'baz' });
55-
56-
setTimeout(() => {
57-
assert.equal(count, 2);
58-
done();
59-
}, 100);
57+
await sleep(1000);
58+
assert.equal(count, 2);
6059
});
6160

62-
it('can subscribe to multiple queries different class', async (done) => {
61+
it('can subscribe to multiple queries different class', async () => {
6362
const objectA = new TestObject();
6463
const objectB = new DiffObject();
6564
await Parse.Object.saveAll([objectA, objectB]);
@@ -81,14 +80,11 @@ describe('Parse LiveQuery', () => {
8180
})
8281
await objectA.save({ foo: 'bar' });
8382
await objectB.save({ foo: 'baz' });
84-
85-
setTimeout(() => {
86-
expect(count).toBe(2);
87-
done();
88-
}, 1000);
83+
await sleep(1000);
84+
assert.equal(count, 2);
8985
});
9086

91-
it('can unsubscribe to multiple queries different class', async (done) => {
87+
it('can unsubscribe to multiple queries different class', async () => {
9288
const objectA = new TestObject();
9389
const objectB = new DiffObject();
9490
await Parse.Object.saveAll([objectA, objectB]);
@@ -110,14 +106,11 @@ describe('Parse LiveQuery', () => {
110106
subscriptionA.unsubscribe();
111107
await objectA.save({ foo: 'bar' });
112108
await objectB.save({ foo: 'baz' });
113-
114-
setTimeout(() => {
115-
assert.equal(count, 1);
116-
done();
117-
}, 1000);
109+
await sleep(1000);
110+
assert.equal(count, 1);
118111
});
119112

120-
it('can unsubscribe with await to multiple queries different class', async (done) => {
113+
it('can unsubscribe with await to multiple queries different class', async () => {
121114
const objectA = new TestObject();
122115
const objectB = new DiffObject();
123116
await Parse.Object.saveAll([objectA, objectB]);
@@ -139,10 +132,7 @@ describe('Parse LiveQuery', () => {
139132
await subscriptionA.unsubscribe();
140133
await objectA.save({ foo: 'bar' });
141134
await objectB.save({ foo: 'baz' });
142-
143-
setTimeout(() => {
144-
assert.equal(count, 1);
145-
done();
146-
}, 1000);
135+
await sleep(1000);
136+
assert.equal(count, 1);
147137
});
148138
});

integration/test/sleep.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = function(ms) {
2+
return new Promise(function(resolve) {
3+
setTimeout(resolve, ms);
4+
});
5+
};

0 commit comments

Comments
 (0)