@orest You don’t want to run jobs in tests. Break the test up and test the individual components separately.
Have one test that asserts the job is dispatched when it should be (i.e. from a controller or whatever). Then write a test specifically for the job that asserts it creates whatever database records it needs to when it’s ran.
it turned out that I had another error which was stopping the jobs from running. now it works without even running a worker. I am not sure how and why the jobs are eventually executed.
The reason that i shouldn't run a job during test is because it can potentially slow down the test ? or there is another reason ?
The reason that i shouldn't run a job during test is because it can potentially slow down the test ? or there is another reason ?
@orest Because you should just be testing your code. Dispatching jobs would mean you would need a queue working running, which is hardware configuration. It’s completely out of the scope of a code test.