Serverless api to retrieve api gateway endpoint for integration tests

I would like to be able my integration tests (jest) to be aware of the API gateway endpoint they should run against for a particular stage. I am happy to import a library to retrieve that information, but would prefer not to try to parse the serverless info yaml. any ideas? Exporting this as an environment variable for the lambda is not what I’m after, as the integration test is not running as a lambda, but invoked by the CI server on the command line.

I can’t see how to use it, but CloudFormation has this:
{ “Ref” : “ApiGatewayRestApi” }