{"action":"created","issue":{"url":"https://api.github.com/repos/nestjs/typescript-starter/issues/34","repository_url":"https://api.github.com/repos/nestjs/typescript-starter","labels_url":"https://api.github.com/repos/nestjs/typescript-starter/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/nestjs/typescript-starter/issues/34/comments","events_url":"https://api.github.com/repos/nestjs/typescript-starter/issues/34/events","html_url":"https://github.com/nestjs/typescript-starter/issues/34","id":310307470,"number":34,"title":"Jest E2E process hangs after executing all tests","user":{"login":"jon301","id":122108,"avatar_url":"https://avatars3.githubusercontent.com/u/122108?v=4","gravatar_id":"","url":"https://api.github.com/users/jon301","html_url":"https://github.com/jon301","followers_url":"https://api.github.com/users/jon301/followers","following_url":"https://api.github.com/users/jon301/following{/other_user}","gists_url":"https://api.github.com/users/jon301/gists{/gist_id}","starred_url":"https://api.github.com/users/jon301/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jon301/subscriptions","organizations_url":"https://api.github.com/users/jon301/orgs","repos_url":"https://api.github.com/users/jon301/repos","events_url":"https://api.github.com/users/jon301/events{/privacy}","received_events_url":"https://api.github.com/users/jon301/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-01T08:25:44Z","updated_at":"2018-05-13T09:34:54Z","closed_at":"2018-05-13T09:34:54Z","author_association":"NONE","body":"Hi,\r\n\r\nGiven this test\r\n```javascript\r\ndescribe('AppController (e2e)', () => {\r\n  let app: INestApplication;\r\n\r\n  beforeAll(async () => {\r\n    const moduleFixture = await Test.createTestingModule({\r\n      imports: [AppModule],\r\n    }).compile();\r\n\r\n    app = moduleFixture.createNestApplication();\r\n    await app.init();\r\n  });\r\n\r\n  afterAll(async () => {\r\n    await app.close();\r\n  });\r\n\r\n  it('/post /graphql', async () => {\r\n    return request(app.getHttpServer())\r\n      .post('/graphql')\r\n      .send({\r\n        query: `{\r\n          users {\r\n            id\r\n          }\r\n        }`,\r\n      })\r\n      .expect(200)\r\n      .expect('{\"data\":{\"users\":[{\"id\":9}]}}');\r\n  });\r\n});\r\n```\r\n\r\nWhen I run jest, the process does not exit after the tests finish:\r\n\r\n<img width=\"403\" alt=\"capture d ecran 2018-04-01 a 10 23 06\" src=\"https://user-images.githubusercontent.com/122108/38171280-e3672746-3596-11e8-8289-b25f964c88cf.png\">\r\n\r\n\r\nI've tried to call `app.close()` in the `afterAll` jest hook but it does not work."},"comment":{"url":"https://api.github.com/repos/nestjs/typescript-starter/issues/comments/388613639","html_url":"https://github.com/nestjs/typescript-starter/issues/34#issuecomment-388613639","issue_url":"https://api.github.com/repos/nestjs/typescript-starter/issues/34","id":388613639,"user":{"login":"kamilmysliwiec","id":23244943,"avatar_url":"https://avatars0.githubusercontent.com/u/23244943?v=4","gravatar_id":"","url":"https://api.github.com/users/kamilmysliwiec","html_url":"https://github.com/kamilmysliwiec","followers_url":"https://api.github.com/users/kamilmysliwiec/followers","following_url":"https://api.github.com/users/kamilmysliwiec/following{/other_user}","gists_url":"https://api.github.com/users/kamilmysliwiec/gists{/gist_id}","starred_url":"https://api.github.com/users/kamilmysliwiec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kamilmysliwiec/subscriptions","organizations_url":"https://api.github.com/users/kamilmysliwiec/orgs","repos_url":"https://api.github.com/users/kamilmysliwiec/repos","events_url":"https://api.github.com/users/kamilmysliwiec/events{/privacy}","received_events_url":"https://api.github.com/users/kamilmysliwiec/received_events","type":"User","site_admin":false},"created_at":"2018-05-13T09:34:54Z","updated_at":"2018-05-13T09:34:54Z","author_association":"OWNER","body":"You can inject `Connection` class into any existing provider as described here: https://docs.nestjs.com/techniques/database\r\n\r\nAlso, you can just query `Connection` token and close it from outside the application: \r\n```\r\nconst connection = app.get(Connection);\r\nawait connection.close();\r\n```"}}
{"actor":{"display_login":"kamilmysliwiec"}}