Skip to content

Commit

Permalink
test(ArchTest): remove skip from arch test
Browse files Browse the repository at this point in the history
- Removed the skip method from the arch test to ensure it runs.
- Updated the Pest test setup to clean up specific PHP files before tests run.
- Added a file creation step for helpers.php to ensure necessary files are present.
  • Loading branch information
guanguans committed Sep 10, 2024
1 parent ce4a7ca commit 716d17b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
12 changes: 8 additions & 4 deletions tests/Feature/ArchTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

/** @noinspection PhpUndefinedMethodInspection */
/** @noinspection StaticClosureCanBeUsedInspection */
/** @noinspection PhpUnhandledExceptionInspection */

Expand All @@ -14,14 +15,17 @@
* @see https://github.com/guanguans/favorite-link
*/

// arch()->preset()->php();
// arch()->preset()->security();
// arch()->preset()->strict();
arch()->preset()->php();
arch()->preset()->security();
arch()->preset()->strict()->ignoring([
App\Commands\Command::class,
App\Commands\FeedCommand::class,
]);
// arch()->preset()->relaxed();

arch('will not use debugging functions')
->group(__DIR__, __FILE__)
->skip()
// ->skip()
->expect([
'echo',
'print',
Expand Down
13 changes: 12 additions & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@
use Pest\Expectation;

uses(Tests\TestCase::class)
->beforeAll(function (): void {})
->beforeAll(function (): void {
foreach (
Symfony\Component\Finder\Finder::create()
->in(__DIR__.'/../vendor/guanguans/ai-commit/app')
->notName('helpers.php')
->name('*.php') as $splFileInfo
) {
unlink($splFileInfo->getPathname());
}

file_put_contents(__DIR__.'/../vendor/guanguans/ai-commit/app/Support/helpers.php', '<?php');
})
->beforeEach(function (): void {})
->afterEach(function (): void {})
->afterAll(function (): void {
Expand Down

0 comments on commit 716d17b

Please sign in to comment.