Skip to content

Commit

Permalink
Final code for NSJS367
Browse files Browse the repository at this point in the history
  • Loading branch information
manikbajaj committed Jun 19, 2024
1 parent 9a4ef41 commit 1ff10aa
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/users/providers/create-user.provider.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Test, TestingModule } from '@nestjs/testing';

import { CreateUserProvider } from './create-user.provider';
import { DataSource } from 'typeorm';
import { HashingProvider } from 'src/auth/providers/hashing.provider';
import { MailService } from 'src/mail/providers/mail.service';
import { User } from '../user.entity';
import { getRepositoryToken } from '@nestjs/typeorm';

describe('CreateUserProvider', () => {
let provider: CreateUserProvider;

beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [
CreateUserProvider,
{ provide: DataSource, useValue: {} },
{ provide: getRepositoryToken(User), useValue: {} },
{ provide: HashingProvider, useValue: {} },
{ provide: MailService, useValue: {} },
],
}).compile();

provider = module.get<CreateUserProvider>(CreateUserProvider);
});

it('Should Be Defined', () => {
expect(provider).toBeDefined();
});
});

0 comments on commit 1ff10aa

Please sign in to comment.