You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I should be able to exclude specific lines in my code with @pest-arch-ignore-line and @pest-arch-ignore-next-line as indicated in the documentation.
I can't make it work by following the documentation steps, so either there is a bug in code or there is a bug in the documentation.
How to Reproduce
Add an architecture test to prevent the use of die. Either explicitly, or via a preset:
test('Classes don\'t use die')
->expect(['die'])
->not->toBeUsed();
or
arch()
->preset()
->php();
In a class method have a die() with one of the following directives:
public static function hola(): void
{
die('This line will be ignored'); // @pest-arch-ignore-line
}
or
public static function hola(): void
{
// @pest-arch-ignore-next-line
die('This line will be ignored');
}
Run Pest:
FAILED Tests\Architecture\ArchitectureTest > Classes don't use die ArchExpectationFailedException
Expecting 'die' not to be used on 'Yolo\Hello'.
at app/Yolo/Hello.php:9
5▕ class Hello
6▕ {
7▕ public static function hola(): void
8▕ {
➜ 9▕ die('This line will be ignored'); // @pest-arch-ignore-line
10▕ }
11▕ }
1 app/Yolo/Hello.php:9
Sorry, filing bugs is one thing but fixing the technical issue is way beyond my technical skills, I fiddled with the files in the Expectation directory to see if an obvious fix was doable, but it's not :)
What Happened
I should be able to exclude specific lines in my code with
@pest-arch-ignore-line
and@pest-arch-ignore-next-line
as indicated in the documentation.I can't make it work by following the documentation steps, so either there is a bug in code or there is a bug in the documentation.
How to Reproduce
Add an architecture test to prevent the use of die. Either explicitly, or via a preset:
or
In a class method have a
die()
with one of the following directives:or
Run Pest:
Sample Repository
https://github.com/pascalchevrel/arch_preset
Pest Version
3.0.1
PHP Version
8.3.6
Operation System
Linux
Notes
No response
The text was updated successfully, but these errors were encountered: