I found 2 ways of testing whether a job is dispatched or not while doing phpUnit based unit testing in Laravel -
1.
$this->expectsJobs(JobClassName::class);
2.
Bus::fake();
Bus::assertDispatched(JobClassName::class);
After scrutinizing Laravel docs, I am not able to figure out which one of the above is a better approach and what is the functional difference between these two approaches.