Rebasely Beta: data may be purged

examples/storefront Public

TypeScript · 16 lines · 437 B · at 5c7d155

// A Queue producer stand-in that keeps what was sent.export class TestQueue<T> {  readonly sent: T[] = [];  async send(body: T): Promise<void> {    this.sent.push(body);  }  async sendBatch(messages: Iterable<{ body: T }>): Promise<void> {    for (const m of messages) this.sent.push(m.body);  }}export function testQueue<T>(): Queue<T> & TestQueue<T> {  return new TestQueue<T>() as unknown as Queue<T> & TestQueue<T>;}