style: fix linting issues met Prettier
This commit is contained in:
		
							parent
							
								
									1b41163064
								
							
						
					
					
						commit
						57da85e14a
					
				
					 3 changed files with 19 additions and 22 deletions
				
			
		|  | @ -22,7 +22,6 @@ describe("ClassController Tests", () => { | ||||||
|         expect(result.class).toHaveProperty("id", testClassId); |         expect(result.class).toHaveProperty("id", testClassId); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|     it("should fetch students for a class", async () => { |     it("should fetch students for a class", async () => { | ||||||
|         const result = await controller.getStudents(testClassId, true); |         const result = await controller.getStudents(testClassId, true); | ||||||
|         expect(result).toHaveProperty("students"); |         expect(result).toHaveProperty("students"); | ||||||
|  |  | ||||||
|  | @ -1,33 +1,33 @@ | ||||||
| import {copyArrayWith} from "../../src/utils/array-utils"; | import { copyArrayWith } from "../../src/utils/array-utils"; | ||||||
| import { describe, it, expect } from "vitest"; | import { describe, it, expect } from "vitest"; | ||||||
| 
 | 
 | ||||||
| describe('copyArrayWith', () => { | describe("copyArrayWith", () => { | ||||||
|     it('should replace the element at the specified index', () => { |     it("should replace the element at the specified index", () => { | ||||||
|         const original = [1, 2, 3, 4]; |         const original = [1, 2, 3, 4]; | ||||||
|         const result = copyArrayWith(2, 99, original); |         const result = copyArrayWith(2, 99, original); | ||||||
|         expect(result).toEqual([1, 2, 99, 4]); |         expect(result).toEqual([1, 2, 99, 4]); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     it('should not modify the original array', () => { |     it("should not modify the original array", () => { | ||||||
|         const original = ['a', 'b', 'c']; |         const original = ["a", "b", "c"]; | ||||||
|         const result = copyArrayWith(1, 'x', original); |         const result = copyArrayWith(1, "x", original); | ||||||
|         expect(original).toEqual(['a', 'b', 'c']); // Original remains unchanged
 |         expect(original).toEqual(["a", "b", "c"]); // Original remains unchanged
 | ||||||
|         expect(result).toEqual(['a', 'x', 'c']); |         expect(result).toEqual(["a", "x", "c"]); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     it('should handle replacing the first element', () => { |     it("should handle replacing the first element", () => { | ||||||
|         const original = [true, false, true]; |         const original = [true, false, true]; | ||||||
|         const result = copyArrayWith(0, false, original); |         const result = copyArrayWith(0, false, original); | ||||||
|         expect(result).toEqual([false, false, true]); |         expect(result).toEqual([false, false, true]); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     it('should handle replacing the last element', () => { |     it("should handle replacing the last element", () => { | ||||||
|         const original = ['apple', 'banana', 'cherry']; |         const original = ["apple", "banana", "cherry"]; | ||||||
|         const result = copyArrayWith(2, 'date', original); |         const result = copyArrayWith(2, "date", original); | ||||||
|         expect(result).toEqual(['apple', 'banana', 'date']); |         expect(result).toEqual(["apple", "banana", "date"]); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     it('should work with complex objects', () => { |     it("should work with complex objects", () => { | ||||||
|         const original = [{ id: 1 }, { id: 2 }, { id: 3 }]; |         const original = [{ id: 1 }, { id: 2 }, { id: 3 }]; | ||||||
|         const newValue = { id: 99 }; |         const newValue = { id: 99 }; | ||||||
|         const result = copyArrayWith(1, newValue, original); |         const result = copyArrayWith(1, newValue, original); | ||||||
|  | @ -35,14 +35,13 @@ describe('copyArrayWith', () => { | ||||||
|         expect(original[1].id).toBe(2); // Original remains unchanged
 |         expect(original[1].id).toBe(2); // Original remains unchanged
 | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
| 
 |     it("should allow setting to undefined", () => { | ||||||
|     it('should allow setting to undefined', () => { |  | ||||||
|         const original = [1, 2, 3]; |         const original = [1, 2, 3]; | ||||||
|         const result = copyArrayWith(1, undefined, original); |         const result = copyArrayWith(1, undefined, original); | ||||||
|         expect(result).toEqual([1, undefined, 3]); |         expect(result).toEqual([1, undefined, 3]); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     it('should allow setting to null', () => { |     it("should allow setting to null", () => { | ||||||
|         const original = [1, 2, 3]; |         const original = [1, 2, 3]; | ||||||
|         const result = copyArrayWith(1, null, original); |         const result = copyArrayWith(1, null, original); | ||||||
|         expect(result).toEqual([1, null, 3]); |         expect(result).toEqual([1, null, 3]); | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| import {LearningPathNode} from "@dwengo-1/backend/dist/entities/content/learning-path-node.entity"; | import { LearningPathNode } from "@dwengo-1/backend/dist/entities/content/learning-path-node.entity"; | ||||||
| import {calculateProgress} from "../../src/utils/assignment-utils"; | import { calculateProgress } from "../../src/utils/assignment-utils"; | ||||||
| import {LearningPath} from "../../src/data-objects/learning-paths/learning-path"; | import { LearningPath } from "../../src/data-objects/learning-paths/learning-path"; | ||||||
| import { describe, it, expect } from "vitest"; | import { describe, it, expect } from "vitest"; | ||||||
| 
 | 
 | ||||||
| describe("calculateProgress", () => { | describe("calculateProgress", () => { | ||||||
|  | @ -68,7 +68,6 @@ describe("calculateProgress", () => { | ||||||
|         expect(calculateProgress(lp)).toBeCloseTo(66.666, 2); |         expect(calculateProgress(lp)).toBeCloseTo(66.666, 2); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|     it("should handle edge case where amountOfNodesLeft is negative", () => { |     it("should handle edge case where amountOfNodesLeft is negative", () => { | ||||||
|         const lp = new LearningPath({ |         const lp = new LearningPath({ | ||||||
|             language: "en", |             language: "en", | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Lint Action
						Lint Action