Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-sa committed Nov 21, 2023
1 parent 830d920 commit e8d730b
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions packages/core/src/lib/types-builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
Positive,
PositiveNoZero,
reflect,
ReflectionClass,
ReflectionClass, ReflectionKind,
ReflectionMethod,
typeOf,
UUID,
Expand Down Expand Up @@ -275,27 +275,24 @@ describe('TypesBuilder', () => {
readonly type: 'cat';
}

type Animals = readonly (Dog | Cat)[];

const list =
builder.createOutputType<Animals>() as GraphQLList<GraphQLObjectType>;
builder.createOutputType<readonly (Dog | Cat)[]>() as GraphQLList<GraphQLObjectType>;

expect(list).toBeInstanceOf(GraphQLList);
expect(list.ofType.name).toEqual('Animals');
expect(list.ofType.toConfig()).toMatchInlineSnapshot(`
{
"astNode": undefined,
"description": undefined,
"extensionASTNodes": [],
"extensions": {},
"name": "Animals",
"resolveType": undefined,
"types": [
"Dog",
"Cat",
],
}
`);
{
"astNode": undefined,
"description": undefined,
"extensionASTNodes": [],
"extensions": {},
"name": "DogCat",
"resolveType": undefined,
"types": [
"Dog",
"Cat",
],
}
`);
});

test('void', () => {
Expand Down Expand Up @@ -331,7 +328,7 @@ describe('TypesBuilder', () => {
const returnType = reflectionMethod.getReturnType();

const type = builder.createReturnType(returnType);
expect(type).toMatchInlineSnapshot();
expect(type).toMatchInlineSnapshot(`"String!"`);
});

test('AsyncGenerator return type', () => {
Expand Down

0 comments on commit e8d730b

Please sign in to comment.