Skip to content

Instantly share code, notes, and snippets.

@colinfwren
Created August 4, 2024 20:14
Show Gist options
  • Save colinfwren/4a1977130a99c5e91569e75015cbcde0 to your computer and use it in GitHub Desktop.
Save colinfwren/4a1977130a99c5e91569e75015cbcde0 to your computer and use it in GitHub Desktop.
Setting up and tearing down Apollo
describe('a feature of the app', () => {
let server, url
beforeAll(async () => {
// assigns the values returned to the variables in the upper scope
({ server, url } = await createApolloServer({ port: 0 }))
})
afterAll(async () => {
await server?.stop()
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment