代码之家  ›  专栏  ›  技术社区  ›  user2167582

当使用nestjs throttler时,我似乎无法导入正确的测试模块来运行单元测试

  •  0
  • user2167582  · 技术社区  · 1 年前

    我目前在尝试使用时遇到以下错误 nestjs/throttler ,

     Nest can't resolve dependencies of the MyThrottlerGuard (?, Symbol(ThrottlerStorage), Reflector). Please make sure that the argument THROTTLER:MODULE_OPTIONS at index [0] is available in the RootTestModule context.
    
        Potential solutions:
        - If THROTTLER:MODULE_OPTIONS is a provider, is it part of the current RootTestModule?
        - If THROTTLER:MODULE_OPTIONS is exported from a separate @Module, is that module imported within RootTestModule?
          @Module({
            imports: [ /* the Module containing THROTTLER:MODULE_OPTIONS */ ]
          })
    
    0 回复  |  直到 1 年前