File tree 1 file changed +15
-0
lines changed 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,21 @@ describe('Cloud Code', () => {
40
40
await expectAsync ( Parse . Cloud . run ( 'hello' ) ) . toBeResolvedTo ( 'Hello world!' ) ;
41
41
} ) ;
42
42
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
+
43
58
it ( 'can load cloud code as a module' , async ( ) => {
44
59
process . env . npm_package_type = 'module' ;
45
60
await reconfigureServer ( { cloud : './spec/cloud/cloudCodeModuleFile.js' } ) ;
You can’t perform that action at this time.
0 commit comments