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
I believe I followed all the instructions in section 4, however, I get the following error when I run npm run test:
{17:27}[ruby-3.0.0]‹node-15.4.0›~/Code/nexus-tutorial:main ✗ ➭ npm run test
> [email protected] test
> npm run generate && jest
> [email protected] generate
> ts-node --transpile-only api/schema
FAIL tests/Post.test.ts
✕ ensures that a draft can be created and published (45 ms)
● ensures that a draft can be created and published
called start() with surprising state started
at ApolloServer.<anonymous> (node_modules/apollo-server-core/src/ApolloServer.ts:510:13)
at node_modules/apollo-server-core/dist/ApolloServer.js:8:71
at Object.<anonymous>.__awaiter (node_modules/apollo-server-core/dist/ApolloServer.js:4:12)
at ApolloServer._start (node_modules/apollo-server-core/dist/ApolloServer.js:226:16)
at ApolloServer.<anonymous> (node_modules/apollo-server/src/index.ts:108:16)
at node_modules/apollo-server/dist/index.js:18:71
● ensures that a draft can be created and published
TypeError: Cannot read property 'request' of undefined
5 | it('ensures that a draft can be created and published', async () => {
6 | // Create a new draft
> 7 | const draftResult = await ctx.client.request(`
| ^
8 | mutation {
9 | createDraft(title: "Nexus", body: "...") {
10 | id
at Object.<anonymous> (tests/Post.test.ts:7:40)
console.log
🚀 Server ready at http://localhost:4000/
at api/server.ts:8:11
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 0.622 s, estimated 1 s
Ran all test suites.
Jest did not exit one second after the test run has completed.
This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
The function createTestContext doesn't seem to be assigning a value to the client key as it's supposed to. Can someone offer me any help with how to get unstuck?
The text was updated successfully, but these errors were encountered:
I have been working my way through this tutorial and really enjoying it. However, I've run into a problem testing. At the end of section 4, here is the state of my code: https://github.com/mullaney/nexus-js-tutorial/tree/28ac581142ac2f49ac46d3769e7810fc13ffb82b
I believe I followed all the instructions in section 4, however, I get the following error when I run
npm run test
:The function createTestContext doesn't seem to be assigning a value to the client key as it's supposed to. Can someone offer me any help with how to get unstuck?
The text was updated successfully, but these errors were encountered: