import { Test, TestingModule } from '@nestjs/testing';
import { SharedService } from './shared.service';
import {SocketGateway} from "../socket/socket.gateway";
import {SocketGatewayMock} from "../mocks/socket-gateway.mock";
import {getModelToken} from "@nestjs/mongoose";
import {Config} from "../schemas/config.schema";
import {Model} from "mongoose";

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

  beforeEach(async () => {
    const module: TestingModule = await Test.createTestingModule({
      providers: [
        SharedService,
        { provide: SocketGateway, useValue: SocketGatewayMock },
        { provide: getModelToken(Config.name), useValue: Model },
      ],
    }).compile();

    service = module.get<SharedService>(SharedService);
  });

  it('should be defined', () => {
    expect(service).toBeDefined();
  });
});
