Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
added close functions to integration tests. Otherwise tests would run forever
  • Loading branch information
maticzav committed Dec 15, 2020
1 parent c280f63 commit 44b1ae6
Show file tree
Hide file tree
Showing 4 changed files with 1,696 additions and 4,255 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
coverageReporters: ['json', 'lcov', 'text', 'clover', 'html'],
globals: {
'ts-jest': {
tsConfig: 'tsconfig.test.json',
tsconfig: 'tsconfig.test.json',
},
},
}
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
"codecov": "^3.8.1",
"graphql": "^14.7.0",
"graphql-yoga": "^1.18.3",
"husky": "^3.1.0",
"jest": "^24.9.0",
"husky": "^4.3.6",
"jest": "^26.6.3",
"prettier": "^1.19.1",
"pretty-quick": "^1.11.1",
"pretty-quick": "^3.1.0",
"request-promise-native": "^1.0.9",
"rimraf": "^2.7.1",
"semantic-release": "^15.13.24",
"ts-jest": "^24.3.0",
"ts-jest": "^26.4.4",
"ts-node": "^8.10.2",
"typescript": "^3.9.7"
},
Expand All @@ -38,8 +37,7 @@
"compile": "tsc -d",
"coverage": "codecov",
"test": "jest",
"prepublishOnly": "npm run compile",
"release": "semantic-release"
"prepublishOnly": "npm run compile"
},
"files": [
"dist"
Expand Down
8 changes: 8 additions & 0 deletions tests/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { AddressInfo } from 'ws'
import { applyMiddleware } from '../src'

describe('integrations', () => {
/* GraphQL Yoga */

test('GraphQL Yoga', async () => {
const typeDefs = `
type Query {
Expand Down Expand Up @@ -56,8 +58,12 @@ describe('integrations', () => {
test: 'pass-test',
},
})

http.close()
})

/* Apollo Server */

test('ApolloServer', async () => {
/* Schema. */
const typeDefs = `
Expand Down Expand Up @@ -108,5 +114,7 @@ describe('integrations', () => {
test: 'pass-test',
},
})

await server.stop()
})
})

0 comments on commit 44b1ae6

Please sign in to comment.