We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing module is currently async, for example:
// tests/user.test.ts import { createTestContext } from './__helpers' const ctx = createTestContext() it('makes sure a user was registered', async () => { const result = await ctx.app.query(` mutation { signupUser(data: { email: "person@email.com", password: "123456" }) } { id email password } `) const createdUsers = await ctx.app.query(`{ users { id } }`) expect(createdUsers).toMatchSnapshot() })
But in a testing context synchronous is usually easier to work with:
// tests/user.test.ts import { createTestContext } from './__helpers' const ctx = createTestContext() it('makes sure a user was registered', () => { const result = ctx.app.query(` mutation { signupUser(data: { email: "person@email.com", password: "123456" }) } { id email password } `) expect(ctx.app.query(`{ users { id } }`)).toMatchSnapshot() })
We could drop async API or make it opt-in, e.g.:
createTestContext({ async: true }) // makes functions on ctx be async
or async function prop on sync functions:
async
ctx.app.query() // Result ctx.app.query.async() // Promise<Result>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What
Testing module is currently async, for example:
But in a testing context synchronous is usually easier to work with:
We could drop async API or make it opt-in, e.g.:
or
async
function prop on sync functions:The text was updated successfully, but these errors were encountered: