diff --git a/tests/Unit/PlaywrightFactoryTest.php b/tests/Unit/PlaywrightFactoryTest.php index aaa8823..7dacb93 100644 --- a/tests/Unit/PlaywrightFactoryTest.php +++ b/tests/Unit/PlaywrightFactoryTest.php @@ -21,14 +21,18 @@ use Playwright\PlaywrightFactory; use Psr\Log\LoggerInterface; +/** + * Every test here must pass an explicit nodePath. + * + * TransportFactory only calls NodeBinaryResolver when the config leaves nodePath + * null, and resolving spawns "node --version" against the real machine. A unit + * test doing that depends on the environment and fails whenever the binary is + * slow to answer. The environment-dependent cases live in + * tests/Integration/PlaywrightFactoryTest.php, where CI installs Node. + */ #[CoversClass(PlaywrightFactory::class)] final class PlaywrightFactoryTest extends TestCase { - public function testCreateWithDefaultConfig(): void - { - $this->assertInstanceOf(PlaywrightClient::class, PlaywrightFactory::create()); - } - public function testCreateWithCustomConfig(): void { $config = new PlaywrightConfig( @@ -43,15 +47,6 @@ public function testCreateWithCustomConfig(): void $this->assertInstanceOf(PlaywrightClient::class, $client); } - public function testCreateWithLogger(): void - { - $logger = $this->createMock(LoggerInterface::class); - - $client = PlaywrightFactory::create(logger: $logger); - - $this->assertInstanceOf(PlaywrightClient::class, $client); - } - public function testCreateWithConfigAndLogger(): void { $config = new PlaywrightConfig(