Skip to content

Commit

Permalink
chore: update dev deps
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Jul 27, 2021
1 parent 20f18d3 commit 0315018
Show file tree
Hide file tree
Showing 4 changed files with 1,653 additions and 3,186 deletions.
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,27 @@
},
"devDependencies": {
"@prisma-labs/prettier-config": "^0.1.0",
"@types/body-parser": "^1.19.0",
"@types/express": "^4.17.8",
"@types/extract-files": "^8.1.0",
"@types/jest": "^26.0.14",
"@types/node": "^14.11.8",
"apollo-server-express": "^2.18.2",
"@types/body-parser": "^1.19.1",
"@types/express": "^4.17.13",
"@types/extract-files": "^8.1.1",
"@types/graphql-upload": "^8.0.6",
"@types/jest": "^26.0.24",
"@types/node": "^16.4.3",
"apollo-server-express": "^3.0.2",
"body-parser": "^1.19.0",
"bundlesize": "^0.18.0",
"doctoc": "^1.4.0",
"doctoc": "^2.0.1",
"dripip": "^0.10.0",
"express": "^4.17.1",
"fetch-cookie": "^0.10.1",
"fetch-cookie": "^1.0.0",
"get-port": "^5.1.1",
"graphql": "^15.3.0",
"graphql-tag": "^2.11.0",
"graphql-upload": "^11.0.0",
"jest": "^26.5.3",
"prettier": "^2.1.2",
"ts-jest": "^26.4.1",
"type-fest": "^0.18.0",
"typescript": "^4.0.3"
"graphql": "^15.5.1",
"graphql-tag": "^2.12.5",
"graphql-upload": "^12.0.0",
"jest": "^27.0.6",
"prettier": "^2.3.2",
"ts-jest": "^27.0.4",
"type-fest": "^1.2.2",
"typescript": "^4.3.5"
},
"prettier": "@prisma-labs/prettier-config",
"jest": {
Expand Down
3 changes: 1 addition & 2 deletions src/types.dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ interface FormData {
interface ReadableStream<R = any> {
readonly locked: boolean
cancel(reason?: any): Promise<void>
getReader(options: { mode: 'byob' }): ReadableStreamBYOBReader
getReader(): ReadableStreamDefaultReader<R>
pipeThrough<T>(
{ writable, readable }: { writable: WritableStream<R>; readable: ReadableStream<T> },
Expand Down Expand Up @@ -111,7 +110,7 @@ interface ReadableStreamReadValueResult<T> {
interface ReadableStreamDefaultReader<R = any> {
readonly closed: Promise<void>
cancel(reason?: any): Promise<void>
read(): Promise<ReadableStreamReadResult<R>>
read(): Promise<ReadableStreamReadResult<R | undefined>>
releaseLock(): void
}

Expand Down
13 changes: 8 additions & 5 deletions tests/__helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ type MockResult<Spec extends MockSpec> = {

export function setupTestServer() {
const ctx = {} as Context
beforeAll(async (done) => {
beforeAll(async () => {
const port = await getPort()
ctx.server = express()
ctx.server.use(body.json())
ctx.nodeServer = createServer()
ctx.nodeServer.listen({ port })
ctx.nodeServer.on('request', ctx.server)
ctx.nodeServer.once('listening', done)
await new Promise((res) => {
ctx.nodeServer.once('listening', res)
})
ctx.url = `http://localhost:${port}`
ctx.res = (spec) => {
const requests: CapturedRequest[] = []
Expand Down Expand Up @@ -86,10 +88,11 @@ type ApolloServerContextOptions = { typeDefs: string; resolvers: any }
export async function startApolloServer({ typeDefs, resolvers }: ApolloServerContextOptions) {
const app = express()

const apolloServer = new ApolloServer({ typeDefs, resolvers, uploads: false })
const apolloServer = new ApolloServer({ typeDefs, resolvers })

app.use(graphqlUploadExpress({ maxFileSize: 10000000, maxFiles: 10 }))
apolloServer.applyMiddleware({ app })
await apolloServer.start()
apolloServer.applyMiddleware({ app: app as any })

let server: Server

Expand All @@ -112,7 +115,7 @@ export function createApolloServerContext({ typeDefs, resolvers }: ApolloServerC
})

afterEach(async () => {
await new Promise((res, rej) => {
await new Promise<void>((res, rej) => {
ctx.server.close((e) => (e ? rej(e) : res()))
})
})
Expand Down
Loading

0 comments on commit 0315018

Please sign in to comment.