Skip to content

Commit ddcddc5

Browse files
committed
increase coverage
1 parent 2e47fb5 commit ddcddc5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

spec/CloudCode.spec.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,21 @@ describe('Cloud Code', () => {
4040
await expectAsync(Parse.Cloud.run('hello')).toBeResolvedTo('Hello world!');
4141
});
4242

43+
it('can load cloud code from function', async () => {
44+
reconfigureServer({
45+
cloud: () => {
46+
Parse.Cloud.define('hello', () => 'Hello world...');
47+
},
48+
});
49+
await expectAsync(Parse.Cloud.run('hello')).toBeResolvedTo('Hello world...');
50+
});
51+
52+
it('cloud code should be a function or string', async () => {
53+
await expectAsync(reconfigureServer({ cloud: [] })).toBeRejectedWith(
54+
"argument 'cloud' must either be a string or a function"
55+
);
56+
});
57+
4358
it('can load cloud code as a module', async () => {
4459
process.env.npm_package_type = 'module';
4560
await reconfigureServer({ cloud: './spec/cloud/cloudCodeModuleFile.js' });

0 commit comments

Comments
 (0)