Skip to content

Commit

Permalink
fix: repaired CI (parse-community#7659) and added spec reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
FransGH committed Oct 28, 2021
1 parent 4ac4b7f commit 93fd9e7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
6 changes: 4 additions & 2 deletions spec/ParseLiveQuery.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ describe('ParseLiveQuery', function () {
const response = (obj, prev) => {
expect(obj.get('sessionToken')).toBeUndefined();
expect(obj.sessionToken).toBeUndefined();
expect(prev?.sessionToken).toBeUndefined();
expect(prev && prev.sessionToken).toBeUndefined();
if (prev && prev.get) {
expect(prev.get('sessionToken')).toBeUndefined();
}
Expand All @@ -967,8 +967,10 @@ describe('ParseLiveQuery', function () {
await user.save();
user.set('yolo', 'bar');
await user.save();
user.set('foo', 'bar');
await user.save();
await user.destroy();
await new Promise(resolve => process.nextTick(resolve));
await new Promise(resolve => setTimeout(resolve, 500));
for (const key of events) {
expect(calls[key]).toHaveBeenCalled();
}
Expand Down
10 changes: 8 additions & 2 deletions spec/ParseUser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3948,7 +3948,7 @@ describe('Parse.User testing', () => {
const response = (obj, prev) => {
expect(obj.get('authData')).toBeUndefined();
expect(obj.authData).toBeUndefined();
expect(prev?.authData).toBeUndefined();
expect(prev && prev.authData).toBeUndefined();
if (prev && prev.get) {
expect(prev.get('authData')).toBeUndefined();
}
Expand All @@ -3967,11 +3967,17 @@ describe('Parse.User testing', () => {
await user.save();
user.set('yolo', 'bar');
await user.save();
user.unset('foo');
await user.save();
await user.destroy();
await new Promise(resolve => process.nextTick(resolve));
await new Promise(resolve => setTimeout(resolve, 500));
for (const key of events) {
expect(calls[key]).toHaveBeenCalled();
}
subscription.unsubscribe();
const client = await Parse.CoreManager.getLiveQueryController().getDefaultLiveQueryClient();
client.close();
await new Promise(resolve => setTimeout(resolve, 500));
});

describe('issue #4897', () => {
Expand Down
12 changes: 12 additions & 0 deletions spec/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
// Sets up a Parse API server for testing.
jasmine.DEFAULT_TIMEOUT_INTERVAL = process.env.PARSE_SERVER_TEST_TIMEOUT || 5000;

const SpecReporter = require('jasmine-spec-reporter').SpecReporter;

jasmine.getEnv().clearReporters(); // remove default reporter logs
jasmine.getEnv().addReporter(
new SpecReporter({
// add jasmine-spec-reporter
spec: {
displayPending: true,
},
})
);

global.on_db = (db, callback, elseCallback) => {
if (process.env.PARSE_SERVER_TEST_DB == db) {
return callback();
Expand Down

0 comments on commit 93fd9e7

Please sign in to comment.