Level 63
Do you have more details about the error ?
In your test, I see that you are using the Http facade. Have you declared it ?
use Illuminate\Support\Facades\Http;
in my laravel app i have a simple http test that have written in pest
it('test http', function () {
$post= [
{some data}
];
$expectedStatusCode = 200;
$response = Http::withHeaders([
'Authorization' => 'Bearer {token}',
])->post({url}, $post);
expect($response->status())->toBe($expectedStatusCode);
}
when i execute the code it return me this error RuntimeException: A facade root has not been set. How can I solve it?
Please or to participate in this conversation.