Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Generate Pest Tests with Cursor

Premium
8:09

Comments & Discussion

PA
Pantelis Antoniadis ✓ Link copied!

at 07m35s: I like the idea to pass the query parameters as args and use the call() method:

$response = $this->call('GET', '/rooms/search', [
	'check_in'  => now()->addDay()->format('Y-m-d'),
	'check_out' => now()->addDays(2)->format('Y-m-d'),
	'guests'    => 2,
]);

get() helper should be extended like the post() helper to pass query parameters as an array.

MS
Mike Scott ✓ Link copied!

The main reason developers don't write unit tests is because they write the code before the test and then can't be bothered adding tests afterwards. However, once one gets in the habit of writing tests first with a rapid red-green-refactor cycle, not only is the coding faster and more satisfying but one feels a lot more confident in the code AND the code will likely be far better structured than it would be if it was written without tests.

I would like to see how Cursor does using this test-driven style.

PK
Povilas Korop ✓ Link copied!

Would be an interesting experiment in the future, I agree.