Skip to content

Commit

Permalink
Merge branch 'fix-lts-ci-7659' of https://github.com/FransGH/parse-se…
Browse files Browse the repository at this point in the history
…rver into fix-lts-ci-7659
  • Loading branch information
FransGH committed Oct 30, 2021
2 parents 30c9bae + 703dbd4 commit 3a46302
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"form-data": "3.0.0",
"husky": "4.2.5",
"jasmine": "3.5.0",
"jasmine-spec-reporter": "^7.0.0",
"jasmine-spec-reporter": "7.0.0",
"jsdoc": "3.6.7",
"jsdoc-babel": "0.5.0",
"lint-staged": "10.2.3",
Expand Down
2 changes: 0 additions & 2 deletions spec/ParseLiveQuery.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -963,8 +963,6 @@ 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 => setTimeout(resolve, 10));
for (const key of events) {
Expand Down
7 changes: 2 additions & 5 deletions spec/ParseUser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3960,24 +3960,21 @@ describe('Parse.User testing', () => {
subscription.on(key, calls[key]);
}
const user = await Parse.User._logInWith('facebook');

user.set('foo', 'bar');
await user.save();
user.unset('foo');
await user.save();
user.set('yolo', 'bar');
await user.save();
user.unset('foo');
await user.save();
await user.destroy();
await new Promise(resolve => setTimeout(resolve, 500));
await new Promise(resolve => setTimeout(resolve, 10));
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));
await new Promise(resolve => setTimeout(resolve, 10));
});

describe('issue #4897', () => {
Expand Down
17 changes: 5 additions & 12 deletions spec/helper.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
'use strict';
const CurrentSpecReporter = require('./support/CurrentSpecReporter.js');
const { SpecReporter } = require('jasmine-spec-reporter');

// 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,
},
})
);
jasmine.getEnv().addReporter(new CurrentSpecReporter());
jasmine.getEnv().addReporter(new SpecReporter());

global.on_db = (db, callback, elseCallback) => {
if (process.env.PARSE_SERVER_TEST_DB == db) {
Expand Down
15 changes: 15 additions & 0 deletions spec/support/CurrentSpecReporter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Sets a global variable to the current test spec
// ex: global.currentSpec.description

global.currentSpec = null;

class CurrentSpecReporter {
specStarted(spec) {
global.currentSpec = spec;
}
specDone() {
global.currentSpec = null;
}
}

module.exports = CurrentSpecReporter;

0 comments on commit 3a46302

Please sign in to comment.