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
Imagine if you have a large seeder that takes 5s to run, and you need to test 20 things after that seed.
If you seed at the beginning of each test you would be waiting a 100 seconds for those tests, but if you could run the seeder once, it will take about 5 seconds, which is a massive improvement.
Please provide a way for us to do this:
beforeAll(fn () => seed());
This is also mentioned in #237 and #246 and #33 (comment)
but sadly they are closed and ignored, but this seems to be a big pain point and a deal breaker for a lot of people.
How to Reproduce
Do beforeAll(fn () => seed()); in a pest test file and you will get this:
assert(array_key_exists(self::FILE, $trace))
at tests/Unit/SomeTest.php:7
3▕ use function Pest\Laravel\assertDatabaseHas;
4▕ use function Pest\Laravel\seed;
5▕
6▕ beforeAll(function () {
➜ 7▕ seed();
8▕ });
Pest Version
2.33.66
PHP Version
8.3.2
Operation System
macOS
The text was updated successfully, but these errors were encountered:
What Happened
Imagine if you have a large seeder that takes 5s to run, and you need to test 20 things after that seed.
If you seed at the beginning of each test you would be waiting a 100 seconds for those tests, but if you could run the seeder once, it will take about 5 seconds, which is a massive improvement.
Please provide a way for us to do this:
This is also mentioned in #237 and #246 and #33 (comment)
but sadly they are closed and ignored, but this seems to be a big pain point and a deal breaker for a lot of people.
How to Reproduce
Do
beforeAll(fn () => seed());
in a pest test file and you will get this:Pest Version
2.33.66
PHP Version
8.3.2
Operation System
macOS
The text was updated successfully, but these errors were encountered: