{"action":"created","issue":{"url":"https://api.github.com/repos/nestjs/nest/issues/363","repository_url":"https://api.github.com/repos/nestjs/nest","labels_url":"https://api.github.com/repos/nestjs/nest/issues/363/labels{/name}","comments_url":"https://api.github.com/repos/nestjs/nest/issues/363/comments","events_url":"https://api.github.com/repos/nestjs/nest/issues/363/events","html_url":"https://github.com/nestjs/nest/issues/363","id":289763215,"number":363,"title":"Unable to run tests because Nest can't resolve dependencies of a service","user":{"login":"mogusbi","id":3741464,"avatar_url":"https://avatars3.githubusercontent.com/u/3741464?v=4","gravatar_id":"","url":"https://api.github.com/users/mogusbi","html_url":"https://github.com/mogusbi","followers_url":"https://api.github.com/users/mogusbi/followers","following_url":"https://api.github.com/users/mogusbi/following{/other_user}","gists_url":"https://api.github.com/users/mogusbi/gists{/gist_id}","starred_url":"https://api.github.com/users/mogusbi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mogusbi/subscriptions","organizations_url":"https://api.github.com/users/mogusbi/orgs","repos_url":"https://api.github.com/users/mogusbi/repos","events_url":"https://api.github.com/users/mogusbi/events{/privacy}","received_events_url":"https://api.github.com/users/mogusbi/received_events","type":"User","site_admin":false},"labels":[{"id":604589830,"url":"https://api.github.com/repos/nestjs/nest/labels/type:%20docs%20:page_facing_up:","name":"type: docs :page_facing_up:","color":"5319e7","default":false},{"id":532263513,"url":"https://api.github.com/repos/nestjs/nest/labels/type:%20question%20%F0%9F%99%8C","name":"type: question 🙌","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":23,"created_at":"2018-01-18T20:21:57Z","updated_at":"2018-04-26T14:07:04Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nPLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.\r\n\r\nISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.\r\n-->\r\n\r\n## I'm submitting a...\r\n<!-- \r\nPlease search GitHub for a similar issue or PR before submitting.\r\nCheck one of the following options with \"x\" -->\r\n<pre><code>\r\n[ ] Regression <!--(a behavior that used to work and stopped working in a new release)-->\r\n[ ] Bug report\r\n[ ] Feature request\r\n[x] Documentation issue or request\r\n[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.\r\n</code></pre>\r\n\r\n## Current behavior\r\nI have followed the unit test example but I am unable to get my very simple test to run (it's literally just testing if true === true)  but it won't work because I'm met with this error\r\n\r\n`Nest can't resolve dependencies of the RoleService (?). Please verify whether [0] argument is available in the current context.`\r\n\r\n## Minimal reproduction of the problem with instructions\r\n<!-- Please share a repo, a gist, or step-by-step instructions. -->\r\nYou can find the repo at https://bitbucket.org/mogusbi/breeze-bb/\r\n\r\nAfter cloning, run `npm run api:test`\r\n\r\n```typescript\r\n// role.controller.spec.ts\r\nimport {Test} from '@nestjs/testing';\r\nimport {TestingModule} from '@nestjs/testing/testing-module';\r\nimport {RoleController} from './role.controller';\r\nimport {RoleService} from './role.service';\r\n\r\ndescribe('Role controller', () => {\r\n  let controller: RoleController;\r\n  let service: RoleService;\r\n\r\n  beforeEach(async () => {\r\n    const mod: TestingModule = await Test\r\n      .createTestingModule({\r\n        components: [\r\n          RoleService\r\n        ],\r\n        controllers: [\r\n          RoleController\r\n        ]\r\n      })\r\n      .compile();\r\n\r\n    controller = mod.get<RoleController>(RoleController);\r\n    service = mod.get<RoleService>(RoleService);\r\n  });\r\n\r\n  it('should be true', () => {\r\n    expect(true).toBe(true);\r\n  });\r\n});\r\n\r\n// role.controller.ts\r\nimport {Controller} from '@nestjs/common';\r\nimport {RoleService} from './role.service';\r\n\r\n@Controller('role')\r\nexport class RoleController {\r\n  constructor (\r\n    private readonly roleService: RoleService\r\n  ) {}\r\n\r\n  ...\r\n}\r\n\r\n// role.service.ts\r\nimport {InjectModel} from '@nestjs/mongoose';\r\nimport {PaginateModel} from 'mongoose';\r\nimport {IRole} from './role.interface';\r\nimport {RoleSchema} from './role.schema';\r\n\r\n@Component()\r\nexport class RoleService {\r\n  constructor (\r\n    @InjectModel(RoleSchema) private readonly model: PaginateModel<IRole>\r\n  ) {}\r\n\r\n  ...\r\n}\r\n```\r\n\r\n## Environment\r\n\r\n<pre><code>\r\n- Node version: 8.2.1\r\n- Platform:  Mac OS 10.13.2\r\n\r\n├── @nestjs/common@4.5.9\r\n├── @nestjs/core@4.5.9\r\n├── @nestjs/mongoose@2.0.0\r\n├── @nestjs/swagger@1.1.3\r\n├── @nestjs/testing@4.5.5\r\n├── @types/body-parser@1.16.8\r\n├── @types/express@4.11.0\r\n├── @types/jest@22.0.1\r\n├── @types/mongoose@4.7.32\r\n├── @types/mongoose-paginate@5.0.6\r\n├── @types/morgan@1.7.35\r\n├── @types/node@8.5.8\r\n├── body-parser@1.18.2\r\n├── class-transformer@0.1.8\r\n├── class-validator@0.7.3\r\n├── jest@22.0.6\r\n├── mongoose@4.13.9\r\n├── mongoose-paginate@5.0.3\r\n├── morgan@1.9.0\r\n├── nodemon@1.14.11\r\n├── reflect-metadata@0.1.10\r\n├── rxjs@5.5.6\r\n├── ts-jest@22.0.1\r\n├── ts-node@4.1.0\r\n├── tslint@5.9.1\r\n├── tslint-eslint-rules@4.1.1\r\n├── tslint-microsoft-contrib@5.0.1\r\n└── typescript@2.6.2\r\n</code></pre>\r\n"},"comment":{"url":"https://api.github.com/repos/nestjs/nest/issues/comments/384653758","html_url":"https://github.com/nestjs/nest/issues/363#issuecomment-384653758","issue_url":"https://api.github.com/repos/nestjs/nest/issues/363","id":384653758,"user":{"login":"ChenShihao","id":16347192,"avatar_url":"https://avatars2.githubusercontent.com/u/16347192?v=4","gravatar_id":"","url":"https://api.github.com/users/ChenShihao","html_url":"https://github.com/ChenShihao","followers_url":"https://api.github.com/users/ChenShihao/followers","following_url":"https://api.github.com/users/ChenShihao/following{/other_user}","gists_url":"https://api.github.com/users/ChenShihao/gists{/gist_id}","starred_url":"https://api.github.com/users/ChenShihao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChenShihao/subscriptions","organizations_url":"https://api.github.com/users/ChenShihao/orgs","repos_url":"https://api.github.com/users/ChenShihao/repos","events_url":"https://api.github.com/users/ChenShihao/events{/privacy}","received_events_url":"https://api.github.com/users/ChenShihao/received_events","type":"User","site_admin":false},"created_at":"2018-04-26T14:07:04Z","updated_at":"2018-04-26T14:07:04Z","author_association":"NONE","body":"@ganchikov +1. Waiting for solution..."}}
{"actor":{"display_login":"ChenShihao"}}