mirror of
https://github.com/pestphp/pest.git
synced 2026-12-04 06:55:05 +01:00
8c635c5ba0
* fix(tia): report a git timeout like any other git failure * fix(tia): raise a git timeout so no git helper reads it as an answer * test(tia): cover a slow git check-ignore and stop probing git after a timeout --------- Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
14 lines
476 B
PHP
14 lines
476 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Pest\Exceptions\GitTimedOut;
|
|
use Pest\Support\Git;
|
|
|
|
it('raises a timed out command instead of answering', function (string $method): void {
|
|
$git = new Git(timeout: 0.2);
|
|
|
|
expect(fn (): mixed => $git->{$method}(['-c', 'alias.slow=!sleep 5', 'slow']))
|
|
->toThrow(GitTimedOut::class, 'Git did not answer within 0.2 seconds: git -c alias.slow=!sleep 5 slow');
|
|
})->with(['result', 'raw', 'output', 'succeeds'])->skipOnWindows();
|