wundergraph.andert.me/test/index.test.ts

17 lines
492 B
TypeScript
Raw Permalink Normal View History

2023-02-27 12:36:40 +00:00
import { afterAll, beforeAll, describe, expect, test } from '@jest/globals';
import { createTestServer } from '../.wundergraph/generated/testing';
const wg = createTestServer();
beforeAll(() => wg.start());
afterAll(() => wg.stop());
describe('SpaceX API', () => {
test('Should return dragons', async () => {
const result = await wg.client().query({
operationName: 'Dragons',
});
const dragons = result.data?.spacex_dragons;
expect(dragons?.length).toBeGreaterThan(0);
});
});