You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In tests, I may want to define a variable of type TestModuleConfig scoped for the entire test suite. It is not possible to get compile errors at the declaration site because TestModuleConfig is not exposed. Further, if I want to modify that object later, I won't receive compile time errors at that line of code.
Copy/pasta of the type into a project or each test file is not ideal, especially if the type changes on this project.
Additional context
If the type is exposed, users would be able to do this.
// using something like Jestdescribe('my test',()=>{letconfig: TestModuleConfig;beforeEach(()=>{config={ ...baseConfigStuff};});test('first test',()=>{constapp=testkit.mockModule(someModule,config);});test('second test which modifies config',()=>{config.typeDefs='wrong type';// GET AN ERROR RIGHT HERE'constapp=testkit.mockModule(someModule,config);});
Perhaps there are other types worth exporting as well, but this is one I've come across thus far.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
In tests, I may want to define a variable of type
TestModuleConfig
scoped for the entire test suite. It is not possible to get compile errors at the declaration site becauseTestModuleConfig
is not exposed. Further, if I want to modify that object later, I won't receive compile time errors at that line of code.Describe the solution you'd like
Export this type to users of
graphql-modules
https://github.com/Urigo/graphql-modules/blob/75552e6775202a8c8a69d3aa587033d9c0987da2/packages/graphql-modules/src/testing/test-module.ts#L29-L38Describe alternatives you've considered
Copy/pasta of the type into a project or each test file is not ideal, especially if the type changes on this project.
Additional context
If the type is exposed, users would be able to do this.
Perhaps there are other types worth exporting as well, but this is one I've come across thus far.
The text was updated successfully, but these errors were encountered: