mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-27 00:17:18 +00:00
* eslint-setup: rules for frontend and server * setup pre-commit:hook * frontend:eslint fixes * frontend eslint errors and warning fixed * eslint:fix for ./server * fix server/test: expectatin string lint/error * pre-commit:updated * removed unwanted install cmd from docker file * recommended settings and extension for vscode * husky prepare script added * updated extension recommendations * added prettier as recommended extension * added pre-commit to package.json * remove .prettierrc file * resolve changes * resolve changes
28 lines
825 B
TypeScript
28 lines
825 B
TypeScript
import { Test, TestingModule } from '@nestjs/testing';
|
|
import GraphqlQueryService from '.';
|
|
|
|
describe('GraphqlQueryService', () => {
|
|
let service: GraphqlQueryService;
|
|
|
|
beforeEach(async () => {
|
|
const module: TestingModule = await Test.createTestingModule({
|
|
providers: [GraphqlQueryService],
|
|
}).compile();
|
|
|
|
service = module.get<GraphqlQueryService>(GraphqlQueryService);
|
|
});
|
|
|
|
it('should query graphql datasources', async () => {
|
|
const sourceOptions = {
|
|
url: 'https://api.spacex.land/graphql/',
|
|
headers: [],
|
|
url_params: [],
|
|
};
|
|
|
|
const queryOptions = { query: '{ launchesPast(limit: 10) { mission_name } }' };
|
|
|
|
const result = await service.run(sourceOptions, queryOptions, 'no-datasource-id');
|
|
|
|
expect(result.data['data']['launchesPast'].length).toBe(10);
|
|
});
|
|
});
|