setUpComponentTest(); }); describe('Exception Test Harness', function () { it('handles BadMethodCallException manually', function () { $component = ComponentFactory::make() ->withId('error:component') ->withState(['data' => 'test']) ->withAction('fail', function () { throw new \RuntimeException('Expected error'); }) ->create(); $exceptionThrown = false; try { $this->callAction($component, 'fail'); } catch (\RuntimeException $e) { $exceptionThrown = true; } expect($exceptionThrown)->toBeTrue(); }); });