File tree 2 files changed +10
-10
lines changed
apollo-client/v3/schema-driven-testing/src/__tests__
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import graphqlSchema from "../../../schema.graphql";
9
9
10
10
const staticSchema = makeExecutableSchema ( { typeDefs : graphqlSchema } ) ;
11
11
12
- export let schemaProxy = createTestSchema ( staticSchema , {
12
+ export let testSchema = createTestSchema ( staticSchema , {
13
13
resolvers : {
14
14
Query : {
15
15
products : ( ) => [
@@ -27,12 +27,12 @@ export let schemaProxy = createTestSchema(staticSchema, {
27
27
} ,
28
28
} ) ;
29
29
30
- export function replaceSchema ( newSchema : typeof schemaProxy ) {
31
- const oldSchema = schemaProxy ;
32
- schemaProxy = newSchema ;
30
+ export function replaceSchema ( newSchema : typeof testSchema ) {
31
+ const oldSchema = testSchema ;
32
+ testSchema = newSchema ;
33
33
34
34
function restore ( ) {
35
- schemaProxy = oldSchema ;
35
+ testSchema = oldSchema ;
36
36
}
37
37
38
38
return Object . assign ( restore , {
@@ -50,7 +50,7 @@ export const handlers = [
50
50
const result = await execute ( {
51
51
document,
52
52
operationName,
53
- schema : schemaProxy ,
53
+ schema : testSchema ,
54
54
variableValues : variables ,
55
55
} ) ;
56
56
Original file line number Diff line number Diff line change 8
8
import { Products } from "../../products" ;
9
9
import { server } from "../mocks/server" ;
10
10
import { makeClient } from "../../client" ;
11
- import { replaceSchema , schemaProxy } from "../mocks/handlers" ;
11
+ import { replaceSchema , testSchema } from "../mocks/handlers" ;
12
12
13
13
// The following server set-up, reset and teardown would normally be
14
14
// done in a `setupTests.ts` file. Since we're using Jest to run both
@@ -39,7 +39,7 @@ describe("Products", () => {
39
39
} ) ;
40
40
41
41
test ( "allows resolvers to be updated via .add" , async ( ) => {
42
- schemaProxy . add ( {
42
+ testSchema . add ( {
43
43
resolvers : {
44
44
Query : {
45
45
products : ( ) => {
@@ -63,7 +63,7 @@ describe("Products", () => {
63
63
} ) ;
64
64
65
65
test ( "allows resolvers to be updated via .fork and replaceSchema" , async ( ) => {
66
- const newSchema = schemaProxy . fork ( {
66
+ const newSchema = testSchema . fork ( {
67
67
resolvers : {
68
68
Query : {
69
69
products : ( ) => {
@@ -89,7 +89,7 @@ describe("Products", () => {
89
89
} ) ;
90
90
91
91
test ( "handles test schema resetting via .reset" , async ( ) => {
92
- schemaProxy . reset ( ) ;
92
+ testSchema . reset ( ) ;
93
93
94
94
render ( makeClient ( ) ) ;
95
95
You can’t perform that action at this time.
0 commit comments