title: Nest can't resolve dependencies of the JokesService (?)
body: <p>I am learning NestJS and I a bit confused of how this &quot;modules&quot; work. I only have two modules, <code>JokesModule</code> and <code>ChuckNorrisApiModule</code>, and I am trying to use the service of <code>ChukNorrisService</code> in <code>JokesService</code>.
  I am already exporting the <code>ChuckNorrisService</code> and importing <code>ChuckNorrisModule</code> into the <code>JokesModule</code>.</p>
  <p>It runs good, the compiler does't throw any errors, but when I run the tests (which comes with the <code>nest g service</code> and <code>nest g module</code>), it fails.</p>
  <p>The modules:</p>
  <pre class="lang-js prettyprint-override"><code>@Module({
    providers: [ChuckNorrisApiService],
    imports: [HttpModule],
    exports: [ChuckNorrisApiService]
  })
  export class ChuckNorrisApiModule {}
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>@Module({
    providers: [JokesService],
    imports: [ChuckNorrisApiModule]
  })
  export class JokesModule {}
  </code></pre>
  <p>And the services:</p>
  <pre class="lang-js prettyprint-override"><code>@Injectable()
  export class ChuckNorrisApiService {
      constructor(private httpService: HttpService) {}
  }
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>@Injectable()
  export class JokesService {
    constructor(
      private readonly service: ChuckNorrisApiService,
    ) {}
  }
  </code></pre>
  <p>The test:</p>
  <pre class="lang-js prettyprint-override"><code>describe('JokesService', () =&gt; {
    let service: JokesService;
  
    beforeEach(async () =&gt; {
      const module: TestingModule = await Test.createTestingModule({
        providers: [JokesService],
      }).compile();
  
      service = module.get&lt;JokesService&gt;(JokesService);
    });
  
    it('should be defined', () =&gt; {
      expect(service).toBeDefined();
    });
  });
  </code></pre>
  <p>And the error:</p>
  <pre class="lang-sh prettyprint-override"><code>Nest cant resolve dependencies of the JokesService (?). Please make sure that the
   argument ChuckNorrisApiService at index [0] is available in the RootTestModule context.
  
      Potential solutions:
      - If ChuckNorrisApiService is a provider, is it part of the current RootTestModule?
      - If ChuckNorrisApiService is exported from a separate @Module, is that module imported within RootTestModule?
        @Module({
          imports: [ /* the Module containing ChuckNorrisApiService */ ]
        })
  </code></pre>
  <p>Just a question for the pros in NestJS, if I only want to use the <code>ChuckNorrisApiService</code> in just one other service, do I to create an entire module for that? What are the best practices for this?</p>
  <p>If someone has any idea why this happens or the answer to the question above, please let me know! Thank You.</p>