Skip to content

Commit 8883541

Browse files
committed
Merge pull request #714 from ParsePlatform/flovilmart.echoKeysTests
Adds test that ensures the keys are properly set when using cloudcode
2 parents bd89338 + e43c471 commit 8883541

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

spec/ParseAPI.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,15 @@ describe('miscellaneous', function() {
372372
done();
373373
});
374374
});
375+
376+
it('test cloud function shoud echo keys', function(done) {
377+
Parse.Cloud.run('echoKeys').then((result) => {
378+
expect(result.applicationId).toEqual(Parse.applicationId);
379+
expect(result.masterKey).toEqual(Parse.masterKey);
380+
expect(result.javascriptKey).toEqual(Parse.javascriptKey);
381+
done();
382+
});
383+
});
375384

376385
it('test rest_create_app', function(done) {
377386
var appId;

spec/cloud/main.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,11 @@ Parse.Cloud.define('requiredParameterCheck', function(req, res) {
100100
}, function(params) {
101101
return params.name;
102102
});
103+
104+
Parse.Cloud.define('echoKeys', function(req, res){
105+
return res.success({
106+
applicationId: Parse.applicationId,
107+
masterKey: Parse.masterKey,
108+
javascriptKey: Parse.javascriptKey
109+
})
110+
});

0 commit comments

Comments
 (0)