setCassette static method
Explicitly set the cassette used by the last client returned by clientForTest.
This is not required if clientForTest was called with
setCassetteFromTestName: true
.
Implementation
static void setCassette(List<String> cassettePathParts) async {
final cassettePath = joinAll(
[
suiteName,
...cassettePathParts,
].map((part) => Slugify(part!.trim(), delimiter: '_')),
) +
'.json';
final interceptor = _activeClient!.interceptor as BetamaxInterceptor;
interceptor.insertCassette(cassettePath);
unawaited(
Invoker.current!.liveTest.onComplete
.then((value) => interceptor.ejectCassette()),
);
}