Complete the code to start the test server before running tests.
beforeAll(async () => { await server.[1](); });The start method launches the test server so tests can run against it.
Complete the code to send a GraphQL query to the test server.
const response = await server.executeOperation({ query: [1] });You need to pass the GraphQL query string or document. GET_USERS_QUERY is the correct query here.
Fix the error in the test assertion to check the response status code.
expect(response.[1]).toBe(200);
The correct property for HTTP status in the response is status.
Fill both blanks to correctly close the test server after all tests.
afterAll(async () => { await server.[1](); await server.[2](); });First, stop the server, then close any open connections.
Fill all three blanks to write a test that sends a mutation and checks the response data.
test('adds a user', async () => { const response = await server.executeOperation({ query: [1], variables: { name: [2] } }); expect(response.data.[3]).toBeDefined(); });
The mutation is ADD_USER_MUTATION, the variable name is the string 'Alice', and the response field is addUser.
