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:
@@ -983,7 +983,7 @@ describe('Cloud Code', () => {
|
|||||||
TODO: fix for Postgres
|
TODO: fix for Postgres
|
||||||
trying to delete a field that doesn't exists doesn't play nice
|
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 TestObject = Parse.Object.extend('TestObject');
|
||||||
const BeforeSaveObject = Parse.Object.extend('BeforeSaveChanged');
|
const BeforeSaveObject = Parse.Object.extend('BeforeSaveChanged');
|
||||||
|
|
||||||
|
|||||||
@@ -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) => {
|
it('fullTextSearch: does not create text index if compound index exist', (done) => {
|
||||||
fullTextHelper().then(() => {
|
fullTextHelper().then(() => {
|
||||||
return databaseAdapter.dropAllIndexes('TestObject');
|
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) => {
|
it('fullTextSearch: $diacriticSensitive - false', (done) => {
|
||||||
fullTextHelper().then(() => {
|
fullTextHelper().then(() => {
|
||||||
const where = {
|
const where = {
|
||||||
|
|||||||
@@ -411,25 +411,17 @@ global.jfail = function(err) {
|
|||||||
|
|
||||||
global.it_exclude_dbs = excluded => {
|
global.it_exclude_dbs = excluded => {
|
||||||
if (excluded.indexOf(process.env.PARSE_SERVER_TEST_DB) >= 0) {
|
if (excluded.indexOf(process.env.PARSE_SERVER_TEST_DB) >= 0) {
|
||||||
return (name, suite) => {
|
return xit;
|
||||||
return xit(`[not on ${excluded.join(',')}] ${name}`, suite);
|
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
return (name, suite) => {
|
return it;
|
||||||
return it(`[not on ${excluded.join(',')}] ${name}`, suite);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global.it_only_db = db => {
|
global.it_only_db = db => {
|
||||||
if (process.env.PARSE_SERVER_TEST_DB === db || !process.env.PARSE_SERVER_TEST_DB && db == 'mongo') {
|
if (process.env.PARSE_SERVER_TEST_DB === db || !process.env.PARSE_SERVER_TEST_DB && db == 'mongo') {
|
||||||
return (name, suite) => {
|
return it;
|
||||||
return it(`[${db}] ${name}`, suite);
|
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
return (name, suite) => {
|
return xit;
|
||||||
return xit(`[${db}] ${name}`, suite);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -443,17 +435,11 @@ global.fit_exclude_dbs = excluded => {
|
|||||||
|
|
||||||
global.describe_only_db = db => {
|
global.describe_only_db = db => {
|
||||||
if (process.env.PARSE_SERVER_TEST_DB == db) {
|
if (process.env.PARSE_SERVER_TEST_DB == db) {
|
||||||
return (name, suite) => {
|
return describe;
|
||||||
return describe(`[${db}] ${name}`, suite);
|
|
||||||
};
|
|
||||||
} else if (!process.env.PARSE_SERVER_TEST_DB && db == 'mongo') {
|
} else if (!process.env.PARSE_SERVER_TEST_DB && db == 'mongo') {
|
||||||
return (name, suite) => {
|
return describe;
|
||||||
return describe(`[${db}] ${name}`, suite);
|
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
return (name, suite) => {
|
return xdescribe;
|
||||||
return xdescribe(`[${db}] ${name}`, suite);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 => {
|
it('sends an error if you use mismatching class names', done => {
|
||||||
request.post({
|
request.post({
|
||||||
url: 'http://localhost:8378/1/schemas/A',
|
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({
|
request.post({
|
||||||
url: 'http://localhost:8378/1/schemas/AClass',
|
url: 'http://localhost:8378/1/schemas/AClass',
|
||||||
headers: masterKeyHeaders,
|
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({
|
request.post({
|
||||||
url: 'http://localhost:8378/1/schemas/AClass',
|
url: 'http://localhost:8378/1/schemas/AClass',
|
||||||
headers: masterKeyHeaders,
|
headers: masterKeyHeaders,
|
||||||
|
|||||||
Reference in New Issue
Block a user