console/integration-tests/testkit/emails.ts
Saihajpreet Singh 642daaf494
Use Envelop v3 and GraphQL Yoga v3 (#443)
Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
Co-authored-by: Kamil Kisiela <kamil.kisiela@gmail.com>
2022-10-06 13:48:01 +02:00

22 lines
505 B
TypeScript

import * as utils from 'dockest/test-helper';
import { fetch } from '@whatwg-node/fetch';
const emailsAddress = utils.getServiceAddress('emails', 3011);
export interface Email {
to: string;
subject: string;
body: string;
}
export async function history(): Promise<Email[]> {
const response = await fetch(`http://${emailsAddress}/_history`, {
method: 'GET',
headers: {
accept: 'application/json',
'content-type': 'application/json',
},
});
return response.json();
}