Skip to content

Commit d718631

Browse files
committed
add demonstration of dev mode
1 parent 579f2ea commit d718631

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
import { describe, it, expect } from '@jest/globals';
2-
import { version } from 'graphql17';
2+
import 'graphql17/dev';
3+
import { GraphQLObjectType, isObjectType, version } from 'graphql17';
34

45
describe('canary ESM graphql v17-alpha', () => {
56
it('should work', () => {
67
expect(version).toBe('17.0.0-alpha.9'); // this version is the latest alpha on which the canary is based
78
});
9+
10+
it('should use development mode when set by our Jest Config', () => {
11+
function getFakeGraphQLObjectType() {
12+
class GraphQLObjectType {
13+
get [Symbol.toStringTag]() {
14+
return 'GraphQLObjectType';
15+
}
16+
}
17+
return new GraphQLObjectType();
18+
}
19+
20+
expect(isObjectType(new GraphQLObjectType({ name: 'SomeType', fields: {} }))).toBe(true);
21+
expect(() => isObjectType(getFakeGraphQLObjectType())).toThrow();
22+
});
823
});

0 commit comments

Comments
 (0)