Skip to content

1.13.0

Choose a tag to compare

@mozex mozex released this 02 Nov 08:28
· 8 commits to main since this release
Immutable release. Only release title and notes can be modified.
94d5e6b

What's Changed

  • ClientFake answers each call with its method's default fake until you queue a response. preventStrayRequests() makes an unanswered call throw instead.
  • respondTo() answers calls by resource, method or a closure, beside the queue. assertSentTimes(), assertSentInOrder() and sent() are public, and under Pest expect($fake)->toHaveSent(), toHaveSentTimes(), toHaveSentOn(), toHaveSentInOrder() and toHaveSentNothing() work too.
  • Every API exception has a fake() with its status, type and request ID, and TransporterException::fake() stands for a request that got no answer.
  • CreateStreamedResponse::fake() takes a list of events or a CreateResponse, and BatchResultResponse::fake() a list of results. Both carry the same rate-limit headers and request ID as the other fakes.
  • Testing\Blocks builds text, tool use, thinking and web search blocks.
  • Testing\Recorder, a client middleware, records a test's API calls once and replays them from a file afterwards, with no key.
  • batches()->wait() polls a batch until it ends. BatchResponse has isEnded(), and batch results have succeeded(), errored(), canceled() and expired().
  • messages()->fits() checks a request against a token limit, and trimToFit() drops the oldest turns until it fits.

UPGRADING.md lists the changes that can affect code written against 1.12, such as a fake with no responses no longer throwing.

Full Changelog: 1.12.0...1.13.0