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

How to test jobs using meteortesting:mocha and chai? #3

Closed
mexin opened this issue Dec 4, 2019 · 1 comment
Closed

How to test jobs using meteortesting:mocha and chai? #3

mexin opened this issue Dec 4, 2019 · 1 comment

Comments

@mexin
Copy link

mexin commented Dec 4, 2019

Hello Simon

I've been struggling on how to add test suites for our jobs in a big app we are building, wondering if there is a simple way to test them.

Right now I'm stuck doing a integration test of a function that invokes several chained (using job.depends) jobs, seems the first job stays on "ready" all the time no matter if I try to wait for it, seems it never executes the processJobs callback.

Any help or insight will be highly appreciated.

Thank you!

@SimonSimCity
Copy link
Owner

Well, when thinking about this, you shouldn't test the chaining itself. I personally take the code, executed in a job, as an exportable function and test it. If I would have several chained jobs, I would take each part and test it as one individual unit. The combination then has to work like in a micro-service environment.

Imagine, you have a ton of several applications - each of them in your case is a job, happen to be written in the same language and framework - but this could also be different, right? At least when thinking of it as micro-services. You'd then try a superrior unit to test this. This could be done by having your application running in a production-like environment and testing the outcome on the UI, which is what we're doing. A useful tools for this is Chimpy which also has a special meteor integration.

Hope this helps.

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

No branches or pull requests

2 participants