This commit is contained in:
roschaefer 2019-09-12 23:13:20 +02:00
parent 9233049ff3
commit 86f9824c2e

View File

@ -114,7 +114,7 @@ describe('slugifyMiddleware', () => {
}) })
describe('but if the client specifies a slug', () => { describe('but if the client specifies a slug', () => {
it('rejects CreatePost', async (done) => { it('rejects CreatePost', async done => {
variables = { variables = {
...variables, ...variables,
title: 'Pre-existing post', title: 'Pre-existing post',
@ -123,7 +123,9 @@ describe('slugifyMiddleware', () => {
categoryIds, categoryIds,
} }
try { try {
await expect(mutate({ mutation: createPostMutation, variables })).resolves.toMatchObject({ await expect(
mutate({ mutation: createPostMutation, variables }),
).resolves.toMatchObject({
errors: [ errors: [
{ {
message: 'Post with this slug already exists!', message: 'Post with this slug already exists!',
@ -131,7 +133,7 @@ describe('slugifyMiddleware', () => {
], ],
}) })
done() done()
} catch(error) { } catch (error) {
throw new Error(` throw new Error(`
${error} ${error}