-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ce6437
commit e9fd211
Showing
13 changed files
with
272 additions
and
66 deletions.
There are no files selected for viewing
22 changes: 18 additions & 4 deletions
22
apps/back-end/src/answer-type/answer-type.controller.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { AnswerTypeController } from './answer-type.controller'; | ||
import { AnswerTypeService } from './answer-type.service'; | ||
|
||
const mockAnswerTypeService = {}; | ||
describe('AnswerTypeController', () => { | ||
let controller: AnswerTypeController; | ||
let answerTypeController: AnswerTypeController; | ||
let answerTypeService: AnswerTypeService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [AnswerTypeController], | ||
providers: [ | ||
{ | ||
provide: AnswerTypeService, | ||
useValue: mockAnswerTypeService, | ||
}, | ||
], | ||
}).compile(); | ||
|
||
controller = module.get<AnswerTypeController>(AnswerTypeController); | ||
answerTypeController = | ||
module.get<AnswerTypeController>(AnswerTypeController); | ||
answerTypeService = module.get<AnswerTypeService>(AnswerTypeService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).toBeDefined(); | ||
it('answer-type controller should be defined', () => { | ||
expect(answerTypeController).toBeDefined(); | ||
}); | ||
it('answer-type service should be defined', () => { | ||
expect(answerTypeService).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { AnswerTypeService } from './answer-type.service'; | ||
|
||
const mockAnswerTypeService = {}; | ||
|
||
describe('AnswerTypeService', () => { | ||
let service: AnswerTypeService; | ||
let answerTpeservice: AnswerTypeService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [AnswerTypeService], | ||
providers: [ | ||
{ | ||
provide: AnswerTypeService, | ||
useValue: mockAnswerTypeService, | ||
}, | ||
], | ||
}).compile(); | ||
|
||
service = module.get<AnswerTypeService>(AnswerTypeService); | ||
answerTpeservice = module.get<AnswerTypeService>(AnswerTypeService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(service).toBeDefined(); | ||
expect(answerTpeservice).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,54 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { EncountersService } from '../encounters/encounters.service'; | ||
import { QuestionService } from '../question/question.service'; | ||
import { AnswerController } from './answer.controller'; | ||
import { AnswerService } from './answer.service'; | ||
|
||
const mockAnswerService = {}; | ||
const mockQuestionService = {}; | ||
const mockEncounterService = {}; | ||
|
||
describe('AnswerController', () => { | ||
let controller: AnswerController; | ||
let answerController: AnswerController; | ||
let answerService: AnswerService; | ||
let qstnService: QuestionService; | ||
let encounterService: EncountersService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [AnswerController], | ||
providers: [ | ||
{ | ||
provide: AnswerService, | ||
useValue: mockAnswerService, | ||
}, | ||
{ | ||
provide: QuestionService, | ||
useValue: mockQuestionService, | ||
}, | ||
{ | ||
provide: EncountersService, | ||
useValue: mockEncounterService, | ||
}, | ||
], | ||
}).compile(); | ||
|
||
controller = module.get<AnswerController>(AnswerController); | ||
answerController = module.get<AnswerController>(AnswerController); | ||
answerService = module.get<AnswerService>(AnswerService); | ||
qstnService = module.get<QuestionService>(QuestionService); | ||
encounterService = module.get<EncountersService>(EncountersService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).toBeDefined(); | ||
it('answer controller should be defined', () => { | ||
expect(answerController).toBeDefined(); | ||
}); | ||
it('question service should be defined', () => { | ||
expect(qstnService).toBeDefined(); | ||
}); | ||
it('answer service should be defined', () => { | ||
expect(answerService).toBeDefined(); | ||
}); | ||
it('encounters service should be defined', () => { | ||
expect(encounterService).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { AnswerService } from './answer.service'; | ||
|
||
const mockAnswerService = {}; | ||
|
||
describe('AnswerService', () => { | ||
let service: AnswerService; | ||
let answerService: AnswerService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [AnswerService], | ||
providers: [ | ||
{ | ||
provide: AnswerService, | ||
useValue: mockAnswerService, | ||
}, | ||
], | ||
}).compile(); | ||
|
||
service = module.get<AnswerService>(AnswerService); | ||
answerService = module.get<AnswerService>(AnswerService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(service).toBeDefined(); | ||
it('answer service should be defined', () => { | ||
expect(answerService).toBeDefined(); | ||
}); | ||
}); |
46 changes: 42 additions & 4 deletions
46
apps/back-end/src/form-question/form-question.controller.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,56 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { FormService } from '../form/form.service'; | ||
import { QuestionService } from '../question/question.service'; | ||
import { FormQuestionController } from './form-question.controller'; | ||
import { FormQuestionService } from './form-question.service'; | ||
|
||
const mockFormQuestionService = {}; | ||
const mockFormService = {}; | ||
const mockQuestionService = {}; | ||
|
||
describe('FormQuestionController', () => { | ||
let controller: FormQuestionController; | ||
let formQuestionController: FormQuestionController; | ||
let formQuestionService: FormQuestionService; | ||
let formService: FormService; | ||
let questionService: QuestionService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [FormQuestionController], | ||
providers: [ | ||
{ | ||
provide: FormQuestionService, | ||
useValue: mockFormQuestionService, | ||
}, | ||
{ | ||
provide: FormService, | ||
useValue: mockFormService, | ||
}, | ||
{ | ||
provide: QuestionService, | ||
useValue: mockQuestionService, | ||
}, | ||
], | ||
}).compile(); | ||
|
||
controller = module.get<FormQuestionController>(FormQuestionController); | ||
formQuestionController = module.get<FormQuestionController>( | ||
FormQuestionController | ||
); | ||
formQuestionService = module.get<FormQuestionService>(FormQuestionService); | ||
formService = module.get<FormService>(FormService); | ||
questionService = module.get<QuestionService>(QuestionService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).toBeDefined(); | ||
it('form question controller should be defined', () => { | ||
expect(formQuestionController).toBeDefined(); | ||
}); | ||
it('form question service should be defined', () => { | ||
expect(formQuestionService).toBeDefined(); | ||
}); | ||
it('form service should be defined', () => { | ||
expect(formService).toBeDefined(); | ||
}); | ||
it('question service should be defined', () => { | ||
expect(questionService).toBeDefined(); | ||
}); | ||
}); |
17 changes: 12 additions & 5 deletions
17
apps/back-end/src/form-question/form-question.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { FormQuestionService } from './form-question.service'; | ||
|
||
const mockFormQuestionService = {}; | ||
|
||
describe('FormQuestionService', () => { | ||
let service: FormQuestionService; | ||
let formQuestionService: FormQuestionService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [FormQuestionService], | ||
providers: [ | ||
{ | ||
provide: FormQuestionService, | ||
useValue: mockFormQuestionService, | ||
}, | ||
], | ||
}).compile(); | ||
|
||
service = module.get<FormQuestionService>(FormQuestionService); | ||
formQuestionService = module.get<FormQuestionService>(FormQuestionService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(service).toBeDefined(); | ||
it('form question service should be defined', () => { | ||
expect(formQuestionService).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,45 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { EncounterTypesService } from '../encounter-types/encounter-types.service'; | ||
import { FormController } from './form.controller'; | ||
import { FormService } from './form.service'; | ||
|
||
const mockFormService = {}; | ||
const mockEncounterTypeService = {}; | ||
|
||
describe('FormController', () => { | ||
let controller: FormController; | ||
let formController: FormController; | ||
let formService: FormService; | ||
let encounterTypeService: EncounterTypesService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [FormController], | ||
providers: [ | ||
{ | ||
provide: FormService, | ||
useValue: mockFormService, | ||
}, | ||
{ | ||
provide: EncounterTypesService, | ||
useValue: mockEncounterTypeService, | ||
}, | ||
], | ||
}).compile(); | ||
|
||
controller = module.get<FormController>(FormController); | ||
formController = module.get<FormController>(FormController); | ||
formService = module.get<FormService>(FormService); | ||
encounterTypeService = module.get<EncounterTypesService>( | ||
EncounterTypesService | ||
); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).toBeDefined(); | ||
it('form controller should be defined', () => { | ||
expect(formController).toBeDefined(); | ||
}); | ||
it('form service should be defined', () => { | ||
expect(formService).toBeDefined(); | ||
}); | ||
it('encounter-type service should be defined', () => { | ||
expect(encounterTypeService).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { FormService } from './form.service'; | ||
|
||
class mockFormService {} | ||
|
||
describe('FormService', () => { | ||
let service: FormService; | ||
let formService: FormService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [FormService], | ||
providers: [ | ||
{ | ||
provide: FormService, | ||
useClass: mockFormService, | ||
}, | ||
], | ||
}).compile(); | ||
|
||
service = module.get<FormService>(FormService); | ||
formService = module.get<FormService>(FormService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(service).toBeDefined(); | ||
expect(formService).toBeDefined(); | ||
}); | ||
}); |
Oops, something went wrong.