refactor: Bump to jasmine 5.6.0 (#9453)

This commit is contained in:
Diamond Lewis
2025-03-11 15:34:14 -05:00
committed by GitHub
parent 5a2f3b8aec
commit 97d4a9e783
12 changed files with 574 additions and 58 deletions

View File

@@ -287,6 +287,7 @@ describe('Cloud Code Logger', () => {
});
xit('should log a changed beforeSave indicating a change', done => {
pending('needs more work.....');
const logController = new LoggerController(new WinstonLoggerAdapter());
Parse.Cloud.beforeSave('MyObject', req => {
@@ -309,7 +310,7 @@ describe('Cloud Code Logger', () => {
done();
})
.then(null, e => done.fail(JSON.stringify(e)));
}).pend('needs more work.....');
});
it_id('b86e8168-8370-4730-a4ba-24ca3016ad66')(it)('cloud function should obfuscate password', done => {
Parse.Cloud.define('testFunction', () => {

View File

@@ -15,8 +15,8 @@ const fakeClient = {
// These tests are specific to the mongo storage adapter + mongo storage format
// and will eventually be moved into their own repo
describe_only_db('mongo')('MongoStorageAdapter', () => {
beforeEach(done => {
new MongoStorageAdapter({ uri: databaseURI }).deleteAllClasses().then(done, fail);
beforeEach(async () => {
await new MongoStorageAdapter({ uri: databaseURI }).deleteAllClasses();
Config.get(Parse.applicationId).schemaCache.clear();
});

View File

@@ -4,7 +4,7 @@ const request = require('../lib/request');
const Config = require('../lib/Config');
describe('a GlobalConfig', () => {
beforeEach(done => {
beforeEach(async () => {
const config = Config.get('test');
const query = on_db(
'mongo',
@@ -16,7 +16,7 @@ describe('a GlobalConfig', () => {
return { objectId: '1' };
}
);
config.database.adapter
await config.database.adapter
.upsertOneObject(
'_GlobalConfig',
{
@@ -31,11 +31,7 @@ describe('a GlobalConfig', () => {
params: { companies: ['US', 'DK'], counter: 20, internalParam: 'internal' },
masterKeyOnly: { internalParam: true },
}
)
.then(done, err => {
jfail(err);
done();
});
);
});
const headers = {

View File

@@ -69,8 +69,8 @@ const get = function (url, options) {
};
describe('Parse.Query Aggregate testing', () => {
beforeEach(done => {
loadTestData().then(done, done);
beforeEach(async () => {
await loadTestData();
});
it('should only query aggregate with master key', done => {

View File

@@ -3663,6 +3663,7 @@ describe('Parse.User testing', () => {
});
xit('should not send a verification email if the user signed up using oauth', done => {
pending('this test fails. See: https://github.com/parse-community/parse-server/issues/5097');
let emailCalledCount = 0;
const emailAdapter = {
sendVerificationEmail: () => {
@@ -3691,7 +3692,7 @@ describe('Parse.User testing', () => {
done();
});
});
}).pend('this test fails. See: https://github.com/parse-community/parse-server/issues/5097');
});
it('should be able to update user with authData passed', done => {
let objectId;

View File

@@ -89,8 +89,8 @@ describe('public API', () => {
});
describe('public API without publicServerURL', () => {
beforeEach(done => {
reconfigureServer({ appName: 'unused' }).then(done, fail);
beforeEach(async () => {
await reconfigureServer({ appName: 'unused' });
});
it('should get 404 on verify_email', done => {
request('http://localhost:8378/1/apps/test/verify_email', (err, httpResponse) => {
@@ -115,8 +115,8 @@ describe('public API without publicServerURL', () => {
});
describe('public API supplied with invalid application id', () => {
beforeEach(done => {
reconfigureServer({ appName: 'unused' }).then(done, fail);
beforeEach(async () => {
await reconfigureServer({ appName: 'unused' });
});
it('should get 403 on verify_email', done => {

View File

@@ -23,13 +23,8 @@ function createProduct() {
}
describe('test validate_receipt endpoint', () => {
beforeEach(done => {
createProduct()
.then(done)
.catch(function (err) {
console.error({ err });
done();
});
beforeEach(async () => {
await createProduct();
});
it('should bypass appstore validation', async () => {

View File

@@ -1224,14 +1224,11 @@ describe('PushController', () => {
},
};
beforeEach(done => {
reconfigureServer({
beforeEach(async () => {
await reconfigureServer({
push: { adapter: pushAdapter },
})
.then(() => {
config = Config.get(Parse.applicationId);
})
.then(done, done.fail);
});
config = Config.get(Parse.applicationId);
});
it('should throw if both expiration_time and expiration_interval are set', () => {

View File

@@ -15,9 +15,9 @@ function createUser() {
}
describe_only_db('mongo')('revocable sessions', () => {
beforeEach(done => {
beforeEach(async () => {
// Create 1 user with the legacy
createUser().then(done);
await createUser();
});
it('should upgrade legacy session token', done => {

View File

@@ -243,8 +243,8 @@ describe('Personally Identifiable Information', () => {
});
describe('with deprecated configured sensitive fields', () => {
beforeEach(done => {
return reconfigureServer({ userSensitiveFields: ['ssn', 'zip'] }).then(done);
beforeEach(async () => {
await reconfigureServer({ userSensitiveFields: ['ssn', 'zip'] });
});
it('should be able to get own PII via API with object', done => {
@@ -691,12 +691,12 @@ describe('Personally Identifiable Information', () => {
});
describe('with configured sensitive fields via CLP', () => {
beforeEach(done => {
reconfigureServer({
beforeEach(async () => {
await reconfigureServer({
protectedFields: {
_User: { '*': ['ssn', 'zip'], 'role:Administrator': [] },
},
}).then(done);
});
});
it('should be able to get own PII via API with object', done => {