menu
Channels
Team
Posts
Members
Info

Anyone have any insight or links to articles on testing node/ts/graphql setup?

Looking for some tips or articles on testing, ideally related to my setup! I currently have 0 tests in a medium sized backend project. I tried getting it set up initially when I started, but due to lack of experience with the node and testing generally, I set it aside til a…

thumbsup
0
message-simple
0

How to unit test the ApolloProvider from @apollo/react-hooks queries using…

When using MockedProvider in tests, I get the below error is there a different MockedProvider test-utils to test the version of the hooks? Currently, I'm testing it using with the below workaround …

thumbsup
0
message-simple
4

Testing child component that contains ApolloProvider component

I'm writing tests for a component (Backend), specifically testing a callback from a child component (Login) that's triggered via a mutation within it. The problem I'm running into is that the test documentation I'm finding is to wrap the component in a mock provider. There's…

thumbsup
0
message-simple
0

MockedProvider subscription

I'm testing a component that has a Subscription. I mocked this subscription and it's working just fine, as long as I only have one 'it'-block that renders it. Whenever I have more 'it'-blocks rendering the same component but with different mocks, I'm getting errors. Cannot read…

thumbsup
0
message-simple
2

How to mock local state client query?

I'm writing some tests using Jest and react-testing-library. All my mocks are working just fine, except when I try to mock a @client query. It always returns an empty object. When I remove the @client directive, the test passes just fine, but then I get console errors on my…

thumbsup
1
message-simple
0

constructTestServer in apollo-server-testing

do i really need to call constructTestServer() for each test?

thumbsup
0
message-simple
0

Issue with createTestClient and ApolloServer when using Typescript

I am having a problem with creating a test client in my integration tests since converting our project to TypeScript. Following the pattern described in the integraton test examples provided in the full stack example app I am having a type collision when trying to pass an…

thumbsup
0
message-simple
0

withApollo `TypeError: Cannot read property 'query' of undefined`

libraries used Component setup Unit Test …

thumbsup
1
message-simple
1

Is there a way to ignore mutation variable matching in mocks?

I'm writing tests for a pretty complicated form and I don't want to mock the entire variables object. I've seen mocking packages for Relay that allow you to turn variable matching off, and was wondering if there's something like that for react-apollo test utils. Additionally I'm…

thumbsup
1
message-simple
2
Deleted·57d# Testing

apollo-datasource-rest + Typescript + Jest

I am setting up a new project using Apollo, TypeScript & Jest and I'm running into some difficulty testing my datasources that extent RESTDataSource. Jest will not mock the class to be extended & much of the advice I'm coming across recommends switching to composition over…

thumbsup
0
message-simple
1