Fix: Proper handling of arrays for cloud validator (#7178)

* fix: proper handling of arrays for cloud validator

* Update CloudCode.Validator.spec.js
This commit is contained in:
dblythy
2021-02-11 17:29:34 +11:00
committed by GitHub
parent 7f47b0427e
commit 27d56f0801
2 changed files with 20 additions and 3 deletions

View File

@@ -264,6 +264,24 @@ describe('cloud validator', () => {
});
});
it('set params type allow array', async () => {
Parse.Cloud.define(
'hello',
() => {
return 'Hello world!';
},
{
fields: {
data: {
type: Array,
},
},
}
);
const result = await Parse.Cloud.run('hello', { data: [{ foo: 'bar' }] });
expect(result).toBe('Hello world!');
});
it('set params type', done => {
Parse.Cloud.define(
'hello',