Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Glydric committed Jan 20, 2024
1 parent 7628a7a commit f8900c4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Backend/src/app/shared/shared.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Test, TestingModule } from '@nestjs/testing';
import { SharedController } from './shared.controller';
import { DatabaseService } from '../../database/database.service';

describe('SharedController', () => {
let controller: SharedController;

beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [SharedController],
providers: [DatabaseService],
}).compile();

controller = module.get<SharedController>(SharedController);
Expand Down
3 changes: 2 additions & 1 deletion Backend/src/cameraStream/cameraStream.gateway.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import { JwtModule } from '@nestjs/jwt';

import { OpenVidu } from 'openvidu-node-client';
import { CSSOpenVidu } from './open-vidu.service';
import { DatabaseService } from '../database/database.service';

describe('WebStreamGateway', () => {
let gateway: CameraStreamGateway;

beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [CameraStreamGateway, CSSOpenVidu],
providers: [CameraStreamGateway, CSSOpenVidu, DatabaseService],
imports: [
JwtModule.register({
global: true,
Expand Down
6 changes: 3 additions & 3 deletions Backend/src/validators/camera-id/camera.pipe.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ describe('CameraIdPipe', () => {
const validator = new PositiveNumberValidator();
it('should throw as not correct value', () => {
expect(() => validator.transform('-200')).toThrow();
expect(() => validator.transform('200')).toEqual(200);
expect(() => validator.transform(',')).toEqual(undefined);
expect(() => validator.transform(undefined)).toEqual(undefined);
expect(validator.transform('200')).toBe(200);
expect(validator.transform(',')).toEqual(undefined);
expect(validator.transform(undefined)).toEqual(undefined);
});
});

0 comments on commit f8900c4

Please sign in to comment.