Along with @Tatachiblob's answer. I have found some other ways to fix this issue.
$response = $this->post(route('categories.store'), [], [
'accept' => 'application/json',
]);
Or
$response = $this->json('post', route('categories.store'), []);
Hope this will be able to save some time for someone.