Open source omnivore

This commit is contained in:
Jackson Harper
2022-02-11 09:24:33 -08:00
parent b5a6008f76
commit 84f32935f5
1485 changed files with 188409 additions and 0 deletions

24
packages/api/test/util.ts Normal file
View File

@ -0,0 +1,24 @@
import { createApp } from '../src/server'
import supertest from 'supertest'
import { v4 } from 'uuid'
const { app, apollo } = createApp()
export const request = supertest(app)
export const graphqlRequest = (
query: string,
authToken?: string
): supertest.Test => {
return request
.post(apollo.graphqlPath)
.send({
query,
})
.set('Accept', 'application/json')
.set('authorization', authToken || '')
.expect('Content-Type', /json/)
}
export const generateFakeUuid = () => {
return v4()
}