chore: add tests
This commit is contained in:
16
test/index.test.ts
Normal file
16
test/index.test.ts
Normal 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);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user