lkaric / nestjs-twilio

Injectable Twilio client for Nestjs.
https://www.npmjs.com/package/nestjs-twilio
MIT License
43 stars 11 forks source link

testing #10

Closed guiaramos closed 3 years ago

guiaramos commented 3 years ago

How to testing with this module? I am using like this:

  beforeEach(async () => {
    const module: TestingModule = await Test.createTestingModule({
      imports: [
        CacheModule.register(),
        TwilioModule.forRoot({
          accountSid: process.env.TEST_ACCOUNT_SID,
          authToken: process.env.TEST_VERIFICATION_SID,
        }),
      ],
      providers: [
        AuthService,
        AuthResolver,
        AuthConfig,
        CookieService,
        JwtStrategy,
        UserService,
        {
          provide: getModelToken('UserDto'),
          useValue: fakeUsersModel,
        },
      ],
    }).compile();

    service = module.get<AuthService>(AuthService);
  });
lkaric commented 3 years ago

I think you can get a lot of useful things in the https://github.com/rejvban/nestjs-twilio/tree/master/lib/__tests__, and it would be much easier if you were to share what would you exactly like to test.