Skip to content

Commit

Permalink
Convert const "enum-like" maps to TS enums (#3317)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Oct 18, 2021
1 parent 3deb5cc commit 73025aa
Show file tree
Hide file tree
Showing 21 changed files with 250 additions and 232 deletions.
5 changes: 3 additions & 2 deletions src/language/__tests__/printer-test.ts
Expand Up @@ -4,14 +4,15 @@ import { describe, it } from 'mocha';
import { dedent, dedentString } from '../../__testUtils__/dedent';
import { kitchenSinkQuery } from '../../__testUtils__/kitchenSinkQuery';

import { Kind } from '../kinds';
import { parse } from '../parser';
import { print } from '../printer';

describe('Printer: Query document', () => {
it('prints minimal ast', () => {
const ast = {
kind: 'Field',
name: { kind: 'Name', value: 'foo' },
kind: Kind.FIELD,
name: { kind: Kind.NAME, value: 'foo' },
} as const;
expect(print(ast)).to.equal('foo');
});
Expand Down
5 changes: 3 additions & 2 deletions src/language/__tests__/schema-printer-test.ts
Expand Up @@ -4,14 +4,15 @@ import { describe, it } from 'mocha';
import { dedent } from '../../__testUtils__/dedent';
import { kitchenSinkSDL } from '../../__testUtils__/kitchenSinkSDL';

import { Kind } from '../kinds';
import { parse } from '../parser';
import { print } from '../printer';

describe('Printer: SDL document', () => {
it('prints minimal ast', () => {
const ast = {
kind: 'ScalarTypeDefinition',
name: { kind: 'Name', value: 'foo' },
kind: Kind.SCALAR_TYPE_DEFINITION,
name: { kind: Kind.NAME, value: 'foo' },
} as const;
expect(print(ast)).to.equal('scalar foo');
});
Expand Down

0 comments on commit 73025aa

Please sign in to comment.