Skip to content

Commit a2c4036

Browse files
authored
Ensures the test suites are properly formed for vscode jasmine plugin (#4901)
* Ensures the test suites are properly formed for vscode jasmine plugin * nit
1 parent efb6c63 commit a2c4036

File tree

4 files changed

+12
-41
lines changed

4 files changed

+12
-41
lines changed

spec/CloudCode.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ describe('Cloud Code', () => {
983983
TODO: fix for Postgres
984984
trying to delete a field that doesn't exists doesn't play nice
985985
*/
986-
it_exclude_dbs(['postgres'])('should fully delete objects when using `unset` with beforeSave (regression test for #1840)', done => {
986+
it_exclude_dbs(['postgres'])('should fully delete objects when using `unset` and `set` with beforeSave (regression test for #1840)', done => {
987987
const TestObject = Parse.Object.extend('TestObject');
988988
const BeforeSaveObject = Parse.Object.extend('BeforeSaveChanged');
989989

spec/ParseQuery.FullTextSearch.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ describe('Parse.Query Full Text Search testing', () => {
280280
});
281281
});
282282

283-
describe_only_db('mongo')('Parse.Query Full Text Search testing', () => {
283+
describe_only_db('mongo')('[mongodb] Parse.Query Full Text Search testing', () => {
284284
it('fullTextSearch: does not create text index if compound index exist', (done) => {
285285
fullTextHelper().then(() => {
286286
return databaseAdapter.dropAllIndexes('TestObject');
@@ -451,7 +451,7 @@ describe_only_db('mongo')('Parse.Query Full Text Search testing', () => {
451451
});
452452
});
453453

454-
describe_only_db('postgres')('Parse.Query Full Text Search testing', () => {
454+
describe_only_db('postgres')('[postgres] Parse.Query Full Text Search testing', () => {
455455
it('fullTextSearch: $diacriticSensitive - false', (done) => {
456456
fullTextHelper().then(() => {
457457
const where = {

spec/helper.js

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -411,25 +411,17 @@ global.jfail = function(err) {
411411

412412
global.it_exclude_dbs = excluded => {
413413
if (excluded.indexOf(process.env.PARSE_SERVER_TEST_DB) >= 0) {
414-
return (name, suite) => {
415-
return xit(`[not on ${excluded.join(',')}] ${name}`, suite);
416-
};
414+
return xit;
417415
} else {
418-
return (name, suite) => {
419-
return it(`[not on ${excluded.join(',')}] ${name}`, suite);
420-
};
416+
return it;
421417
}
422418
}
423419

424420
global.it_only_db = db => {
425421
if (process.env.PARSE_SERVER_TEST_DB === db || !process.env.PARSE_SERVER_TEST_DB && db == 'mongo') {
426-
return (name, suite) => {
427-
return it(`[${db}] ${name}`, suite);
428-
};
422+
return it;
429423
} else {
430-
return (name, suite) => {
431-
return xit(`[${db}] ${name}`, suite);
432-
};
424+
return xit;
433425
}
434426
};
435427

@@ -443,17 +435,11 @@ global.fit_exclude_dbs = excluded => {
443435

444436
global.describe_only_db = db => {
445437
if (process.env.PARSE_SERVER_TEST_DB == db) {
446-
return (name, suite) => {
447-
return describe(`[${db}] ${name}`, suite);
448-
};
438+
return describe;
449439
} else if (!process.env.PARSE_SERVER_TEST_DB && db == 'mongo') {
450-
return (name, suite) => {
451-
return describe(`[${db}] ${name}`, suite);
452-
};
440+
return describe;
453441
} else {
454-
return (name, suite) => {
455-
return xdescribe(`[${db}] ${name}`, suite);
456-
};
442+
return xdescribe;
457443
}
458444
}
459445

spec/schemas.spec.js

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -262,21 +262,6 @@ describe('schemas', () => {
262262
});
263263
});
264264

265-
it('asks for the master key if you use the rest key', done => {
266-
request.post({
267-
url: 'http://localhost:8378/1/schemas',
268-
json: true,
269-
headers: restKeyHeaders,
270-
body: {
271-
className: 'MyClass',
272-
},
273-
}, (error, response, body) => {
274-
expect(response.statusCode).toEqual(403);
275-
expect(body.error).toEqual('unauthorized: master key is required');
276-
done();
277-
});
278-
});
279-
280265
it('sends an error if you use mismatching class names', done => {
281266
request.post({
282267
url: 'http://localhost:8378/1/schemas/A',
@@ -1248,7 +1233,7 @@ describe('schemas', () => {
12481233
})
12491234
});
12501235

1251-
it('should throw with invalid value', done => {
1236+
it('should throw if permission is number', done => {
12521237
request.post({
12531238
url: 'http://localhost:8378/1/schemas/AClass',
12541239
headers: masterKeyHeaders,
@@ -1266,7 +1251,7 @@ describe('schemas', () => {
12661251
})
12671252
});
12681253

1269-
it('should throw with invalid value', done => {
1254+
it('should throw if permission is empty string', done => {
12701255
request.post({
12711256
url: 'http://localhost:8378/1/schemas/AClass',
12721257
headers: masterKeyHeaders,

0 commit comments

Comments
 (0)