Skip to content

Commit

Permalink
Clean up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eddeee888 committed Dec 22, 2024
1 parent 9d1df52 commit a784d3b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
import '@graphql-codegen/testing';
import { codegen } from '@graphql-codegen/core';
import { parse } from 'graphql';
import { TypeScriptResolversPluginConfig } from '../src/config.js';
import { plugin } from '../src/index.js';

function generate({ schema, config }: { schema: string; config: TypeScriptResolversPluginConfig }) {
return codegen({
filename: 'graphql.ts',
schema: parse(schema),
documents: [],
plugins: [{ 'typescript-resolvers': {} }],
config,
pluginMap: { 'typescript-resolvers': { plugin } },
});
}
import { generate } from './utils';

describe('TypeScript Resolvers Plugin + Apollo Federation - mappers', () => {
it('generates FederationTypes and use it for reference type', async () => {
Expand Down
15 changes: 15 additions & 0 deletions packages/plugins/typescript/resolvers/tests/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { codegen } from '@graphql-codegen/core';
import { parse } from 'graphql';
import { TypeScriptResolversPluginConfig } from '../src/config.js';
import { plugin } from '../src/index.js';

export function generate({ schema, config }: { schema: string; config: TypeScriptResolversPluginConfig }) {
return codegen({
filename: 'graphql.ts',
schema: parse(schema),
documents: [],
plugins: [{ 'typescript-resolvers': {} }],
config,
pluginMap: { 'typescript-resolvers': { plugin } },
});
}

0 comments on commit a784d3b

Please sign in to comment.