import { Test , TestingModule } from '@nestjs/testing' ; import { AuthService } from './auth.service' ; import { PassportModule } from '@nestjs/passport' ; import { LocalStrategy } from './passport/local.strategy' ; import { JwtStrategy } from './passport/jwt.strategy' ; import { UserModule } from '../user/user.module' ; import { JwtModule } from '@nestjs/jwt' ; import { jwtConstants } from './constants' ; describe ( 'AuthService' , ( ) => { let service ; beforeEach ( async ( ) => { const module = await Test . createTestingModule ( { imports : [ UserModule , PassportModule , JwtModule . register ( { secret : jwtConstants . secret , signOptions : { expiresIn : '60s' } , } ) , ] , providers : [ AuthService , LocalStrategy , JwtStrategy ] , exports : [ AuthService ] } ) . compile ( ) ; service = module . get < AuthService > ( AuthService ) ; } ) ; it ( 'should be defined' , ( ) => { expect ( service ) . toBeDefined ( ) ; } ) ; } ) ;