Ensures the test suites are properly formed for vscode jasmine plugin (#4901)

* Ensures the test suites are properly formed for vscode jasmine plugin

* nit
This commit is contained in:
Florent Vilmart
2018-07-19 07:05:27 +00:00
committed by GitHub
parent efb6c63a95
commit a2c40367fa
4 changed files with 12 additions and 41 deletions

View File

@@ -983,7 +983,7 @@ describe('Cloud Code', () => {
TODO: fix for Postgres
trying to delete a field that doesn't exists doesn't play nice
*/
it_exclude_dbs(['postgres'])('should fully delete objects when using `unset` with beforeSave (regression test for #1840)', done => {
it_exclude_dbs(['postgres'])('should fully delete objects when using `unset` and `set` with beforeSave (regression test for #1840)', done => {
const TestObject = Parse.Object.extend('TestObject');
const BeforeSaveObject = Parse.Object.extend('BeforeSaveChanged');

View File

@@ -280,7 +280,7 @@ describe('Parse.Query Full Text Search testing', () => {
});
});
describe_only_db('mongo')('Parse.Query Full Text Search testing', () => {
describe_only_db('mongo')('[mongodb] Parse.Query Full Text Search testing', () => {
it('fullTextSearch: does not create text index if compound index exist', (done) => {
fullTextHelper().then(() => {
return databaseAdapter.dropAllIndexes('TestObject');
@@ -451,7 +451,7 @@ describe_only_db('mongo')('Parse.Query Full Text Search testing', () => {
});
});
describe_only_db('postgres')('Parse.Query Full Text Search testing', () => {
describe_only_db('postgres')('[postgres] Parse.Query Full Text Search testing', () => {
it('fullTextSearch: $diacriticSensitive - false', (done) => {
fullTextHelper().then(() => {
const where = {

View File

@@ -411,25 +411,17 @@ global.jfail = function(err) {
global.it_exclude_dbs = excluded => {
if (excluded.indexOf(process.env.PARSE_SERVER_TEST_DB) >= 0) {
return (name, suite) => {
return xit(`[not on ${excluded.join(',')}] ${name}`, suite);
};
return xit;
} else {
return (name, suite) => {
return it(`[not on ${excluded.join(',')}] ${name}`, suite);
};
return it;
}
}
global.it_only_db = db => {
if (process.env.PARSE_SERVER_TEST_DB === db || !process.env.PARSE_SERVER_TEST_DB && db == 'mongo') {
return (name, suite) => {
return it(`[${db}] ${name}`, suite);
};
return it;
} else {
return (name, suite) => {
return xit(`[${db}] ${name}`, suite);
};
return xit;
}
};
@@ -443,17 +435,11 @@ global.fit_exclude_dbs = excluded => {
global.describe_only_db = db => {
if (process.env.PARSE_SERVER_TEST_DB == db) {
return (name, suite) => {
return describe(`[${db}] ${name}`, suite);
};
return describe;
} else if (!process.env.PARSE_SERVER_TEST_DB && db == 'mongo') {
return (name, suite) => {
return describe(`[${db}] ${name}`, suite);
};
return describe;
} else {
return (name, suite) => {
return xdescribe(`[${db}] ${name}`, suite);
};
return xdescribe;
}
}

View File

@@ -262,21 +262,6 @@ describe('schemas', () => {
});
});
it('asks for the master key if you use the rest key', done => {
request.post({
url: 'http://localhost:8378/1/schemas',
json: true,
headers: restKeyHeaders,
body: {
className: 'MyClass',
},
}, (error, response, body) => {
expect(response.statusCode).toEqual(403);
expect(body.error).toEqual('unauthorized: master key is required');
done();
});
});
it('sends an error if you use mismatching class names', done => {
request.post({
url: 'http://localhost:8378/1/schemas/A',
@@ -1248,7 +1233,7 @@ describe('schemas', () => {
})
});
it('should throw with invalid value', done => {
it('should throw if permission is number', done => {
request.post({
url: 'http://localhost:8378/1/schemas/AClass',
headers: masterKeyHeaders,
@@ -1266,7 +1251,7 @@ describe('schemas', () => {
})
});
it('should throw with invalid value', done => {
it('should throw if permission is empty string', done => {
request.post({
url: 'http://localhost:8378/1/schemas/AClass',
headers: masterKeyHeaders,