Skip to content

Commit

Permalink
Wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bakerkretzmar committed Oct 3, 2023
1 parent a4b8206 commit acc0987
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/Unit/CommandRouteGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,12 @@ public function can_generate_dts_file()

Artisan::call('ziggy:generate', ['--types' => true]);

dump(file_get_contents(__DIR__ . '/../fixtures/ziggy.d.ts'));
dump(file_get_contents(base_path('resources/js/ziggy.d.ts')));

file_put_contents(
base_path('resources/js/ziggy.d.ts'),
preg_replace('/(\n\r?)/', "\n", file_get_contents(base_path('resources/js/ziggy.d.ts'))),
str_replace("\r", '', file_get_contents(base_path('resources/js/ziggy.d.ts'))),
);

$this->assertFileEquals('./tests/fixtures/ziggy.d.ts', base_path('resources/js/ziggy.d.ts'));
Expand All @@ -173,10 +176,13 @@ public function can_generate_dts_file_with_scoped_bindings()

Artisan::call('ziggy:generate', ['--types' => true]);

dump(file_get_contents(__DIR__ . '/../fixtures/ziggy-7.d.ts'));
dump(file_get_contents(base_path('resources/js/ziggy.d.ts')));

// Normalize line endings (on Windows, `json_encode` uses Windows line endings)
file_put_contents(
base_path('resources/js/ziggy.d.ts'),
preg_replace('/(\n\r?)/', "\n", file_get_contents(base_path('resources/js/ziggy.d.ts'))),
str_replace("\r", '', file_get_contents(base_path('resources/js/ziggy.d.ts'))),
);

$this->assertFileEquals('./tests/fixtures/ziggy-7.d.ts', base_path('resources/js/ziggy.d.ts'));
Expand Down

0 comments on commit acc0987

Please sign in to comment.