You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't understand exactly how @InjectSchedule() works. Can you explain that?
We are using nest-schedule to run batch jobs in our application. I've written an abstract base.schedule class where schedules inherit from then. The constructor header looks like this:
This is the exception: Error: Nest can't resolve dependencies of the BaseScheduleNotAbstract (?, JobService, Number, Number). Please make sure that the argument at index [0] is available in the _RootTestModule context.
So maybe when I understand @InjectSchedule() more clearly I know how to do the testing as well. :)
Thanks for your help!
The text was updated successfully, but these errors were encountered:
The parameter { enable: false } is basically stopping nest-schedule to execute the scheduled functions which comes in quite handy in my case as I only want to test my functions and not nest-schedule.
And by the way as far as I know InjectSchedule it is just a wrapper around the Inject function of nestjs. So basically it is just a custom decorator for dynamically injecting the service. Maybe have look here
Hi there,
I don't understand exactly how
@InjectSchedule()
works. Can you explain that?We are using nest-schedule to run batch jobs in our application. I've written an abstract base.schedule class where schedules inherit from then. The constructor header looks like this:
The question is how to I mock the schedule object in my unit tests?
I've tried like this but I still get an exception:
This is the exception:
Error: Nest can't resolve dependencies of the BaseScheduleNotAbstract (?, JobService, Number, Number). Please make sure that the argument at index [0] is available in the _RootTestModule context.
So maybe when I understand @InjectSchedule() more clearly I know how to do the testing as well. :)
Thanks for your help!
The text was updated successfully, but these errors were encountered: