Merge branch 'dev' into chore/logging
This commit is contained in:
		
						commit
						11e3dc6a3f
					
				
					 48 changed files with 2252 additions and 1541 deletions
				
			
		|  | @ -1,13 +1,13 @@ | |||
| import {setupTestApp} from "../setup-tests.js" | ||||
| import {Student} from "../../src/entities/users/student.entity.js"; | ||||
| import {describe, it, expect, beforeAll} from "vitest"; | ||||
| import {StudentRepository} from "../../src/data/users/student-repository.js"; | ||||
| import {getStudentRepository} from "../../src/data/repositories.js"; | ||||
| import { setupTestApp } from '../setup-tests.js'; | ||||
| import { Student } from '../../src/entities/users/student.entity.js'; | ||||
| import { describe, it, expect, beforeAll } from 'vitest'; | ||||
| import { StudentRepository } from '../../src/data/users/student-repository.js'; | ||||
| import { getStudentRepository } from '../../src/data/repositories.js'; | ||||
| 
 | ||||
| const username = "teststudent"; | ||||
| const firstName = "John"; | ||||
| const lastName = "Doe"; | ||||
| describe("StudentRepository", () => { | ||||
| const username = 'teststudent'; | ||||
| const firstName = 'John'; | ||||
| const lastName = 'Doe'; | ||||
| describe('StudentRepository', () => { | ||||
|     let studentRepository: StudentRepository; | ||||
| 
 | ||||
|     beforeAll(async () => { | ||||
|  | @ -15,8 +15,10 @@ describe("StudentRepository", () => { | |||
|         studentRepository = getStudentRepository(); | ||||
|     }); | ||||
| 
 | ||||
|     it("should return the queried student after he was added", async () => { | ||||
|         await studentRepository.insert(new Student(username, firstName, lastName)); | ||||
|     it('should return the queried student after he was added', async () => { | ||||
|         await studentRepository.insert( | ||||
|             new Student(username, firstName, lastName) | ||||
|         ); | ||||
| 
 | ||||
|         const retrievedStudent = await studentRepository.findByUsername(username); | ||||
|         expect(retrievedStudent).toBeTruthy(); | ||||
|  | @ -24,7 +26,7 @@ describe("StudentRepository", () => { | |||
|         expect(retrievedStudent?.lastName).toBe(lastName); | ||||
|     }); | ||||
| 
 | ||||
|     it("should no longer return the queried student after he was removed again", async () => { | ||||
|     it('should no longer return the queried student after he was removed again', async () => { | ||||
|         await studentRepository.deleteByUsername(username); | ||||
| 
 | ||||
|         const retrievedStudent = await studentRepository.findByUsername(username); | ||||
|  |  | |||
|  | @ -1,9 +1,9 @@ | |||
| import { describe, it, expect } from "vitest"; | ||||
| import { describe, it, expect } from 'vitest'; | ||||
| 
 | ||||
| describe("Sample test", () => { | ||||
|     it("should sum to 2", () => { | ||||
| describe('Sample test', () => { | ||||
|     it('should sum to 2', () => { | ||||
|         const expected = 2; | ||||
|         const result = 1 + 1; | ||||
|         expect(result).equals(expected); | ||||
|     }); | ||||
| }) | ||||
| }); | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| import {initORM} from "../src/orm.js"; | ||||
| import dotenv from "dotenv"; | ||||
| import { initORM } from '../src/orm.js'; | ||||
| import dotenv from 'dotenv'; | ||||
| 
 | ||||
| export async function setupTestApp() { | ||||
|     dotenv.config({path: ".env.test"}); | ||||
|     dotenv.config({ path: '.env.test' }); | ||||
|     await initORM(true); | ||||
| } | ||||
|  |  | |||
		Reference in a new issue