chore: add tests

This commit is contained in:
StarpTech
2023-02-27 13:36:40 +01:00
parent aab6173f05
commit 6672e6c369
5 changed files with 5874 additions and 499 deletions

16
test/index.test.ts Normal file
View File

@ -0,0 +1,16 @@
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);
});
});