Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud jobs #86

Open
coderofsalvation opened this issue Mar 6, 2020 · 0 comments
Open

Cloud jobs #86

coderofsalvation opened this issue Mar 6, 2020 · 0 comments

Comments

@coderofsalvation
Copy link

I didn't really find a way to call cloud jobs using this lib:

(node:9393) UnhandledPromiseRejectionWarning: TypeError: Parse.Cloud.job is not a function

This is my temporary solution by just adding this file mock.CloudJob.js somewhere:

module.exports = function(Parse){
    Parse.Cloud = {
        jobs:{},
        define: function(){},
        job: function(k,f){
            Parse.Cloud.jobs[k] = f
        },
        startJob: function(k,v){
            return Parse.Cloud.jobs[k](v)
        }
    }
}

Now in your code you can do require('mock.CloudJob')(Parse) and register & start Cloud-jobs as usual.

NOTE: I know this hack doesn't really follow the narrative of this lib, therefore I just figured to post this here (instead of doing a PR which doesn't really fit this lib). It might be useful to someone, or could start a brainstorm for Cloud-jobs in parse-mockdb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant