Skip to content

Commit 73025aa

Browse files
Convert const "enum-like" maps to TS enums (#3317)
1 parent 3deb5cc commit 73025aa

21 files changed

+250
-232
lines changed

src/language/__tests__/printer-test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import { describe, it } from 'mocha';
44
import { dedent, dedentString } from '../../__testUtils__/dedent';
55
import { kitchenSinkQuery } from '../../__testUtils__/kitchenSinkQuery';
66

7+
import { Kind } from '../kinds';
78
import { parse } from '../parser';
89
import { print } from '../printer';
910

1011
describe('Printer: Query document', () => {
1112
it('prints minimal ast', () => {
1213
const ast = {
13-
kind: 'Field',
14-
name: { kind: 'Name', value: 'foo' },
14+
kind: Kind.FIELD,
15+
name: { kind: Kind.NAME, value: 'foo' },
1516
} as const;
1617
expect(print(ast)).to.equal('foo');
1718
});

src/language/__tests__/schema-printer-test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import { describe, it } from 'mocha';
44
import { dedent } from '../../__testUtils__/dedent';
55
import { kitchenSinkSDL } from '../../__testUtils__/kitchenSinkSDL';
66

7+
import { Kind } from '../kinds';
78
import { parse } from '../parser';
89
import { print } from '../printer';
910

1011
describe('Printer: SDL document', () => {
1112
it('prints minimal ast', () => {
1213
const ast = {
13-
kind: 'ScalarTypeDefinition',
14-
name: { kind: 'Name', value: 'foo' },
14+
kind: Kind.SCALAR_TYPE_DEFINITION,
15+
name: { kind: Kind.NAME, value: 'foo' },
1516
} as const;
1617
expect(print(ast)).to.equal('scalar foo');
1718
});

0 commit comments

Comments
 (0)