Skip to content

Commit

Permalink
Final Code for NSJS365
Browse files Browse the repository at this point in the history
  • Loading branch information
manikbajaj committed Jun 19, 2024
1 parent d2d7231 commit 95f0deb
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/users/providers/users.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
import { Test, TestingModule } from '@nestjs/testing';

import { CreateGoogleUserProvider } from './create-google-user.provider';
import { CreateUserProvider } from './create-user.provider';
import { DataSource } from 'typeorm';
import { FindOneByGoogleIdProvider } from './find-one-by-google-id.provider';
import { FindOneUserByEmailProvider } from './find-one-user-by-email.provider';
import { User } from '../user.entity';
import { UsersCreateManyProvider } from './users-create-many.provider';
import { UsersService } from './users.service';
import { getRepositoryToken } from '@nestjs/typeorm';

describe('UsersService', () => {
let service: UsersService;

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

service = module.get<UsersService>(UsersService);
Expand Down

0 comments on commit 95f0deb

Please sign in to comment.