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);
|
||||
});
|
||||
|
||||
|
||||
it("should fetch students for a class", async () => {
|
||||
const result = await controller.getStudents(testClassId, true);
|
||||
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";
|
||||
|
||||
describe('copyArrayWith', () => {
|
||||
it('should replace the element at the specified index', () => {
|
||||
describe("copyArrayWith", () => {
|
||||
it("should replace the element at the specified index", () => {
|
||||
const original = [1, 2, 3, 4];
|
||||
const result = copyArrayWith(2, 99, original);
|
||||
expect(result).toEqual([1, 2, 99, 4]);
|
||||
});
|
||||
|
||||
it('should not modify the original array', () => {
|
||||
const original = ['a', 'b', 'c'];
|
||||
const result = copyArrayWith(1, 'x', original);
|
||||
expect(original).toEqual(['a', 'b', 'c']); // Original remains unchanged
|
||||
expect(result).toEqual(['a', 'x', 'c']);
|
||||
it("should not modify the original array", () => {
|
||||
const original = ["a", "b", "c"];
|
||||
const result = copyArrayWith(1, "x", original);
|
||||
expect(original).toEqual(["a", "b", "c"]); // Original remains unchanged
|
||||
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 result = copyArrayWith(0, false, original);
|
||||
expect(result).toEqual([false, false, true]);
|
||||
});
|
||||
|
||||
it('should handle replacing the last element', () => {
|
||||
const original = ['apple', 'banana', 'cherry'];
|
||||
const result = copyArrayWith(2, 'date', original);
|
||||
expect(result).toEqual(['apple', 'banana', 'date']);
|
||||
it("should handle replacing the last element", () => {
|
||||
const original = ["apple", "banana", "cherry"];
|
||||
const result = copyArrayWith(2, "date", original);
|
||||
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 newValue = { id: 99 };
|
||||
const result = copyArrayWith(1, newValue, original);
|
||||
|
@ -35,14 +35,13 @@ describe('copyArrayWith', () => {
|
|||
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 result = copyArrayWith(1, undefined, original);
|
||||
expect(result).toEqual([1, undefined, 3]);
|
||||
});
|
||||
|
||||
it('should allow setting to null', () => {
|
||||
it("should allow setting to null", () => {
|
||||
const original = [1, 2, 3];
|
||||
const result = copyArrayWith(1, null, original);
|
||||
expect(result).toEqual([1, null, 3]);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {LearningPathNode} from "@dwengo-1/backend/dist/entities/content/learning-path-node.entity";
|
||||
import {calculateProgress} from "../../src/utils/assignment-utils";
|
||||
import {LearningPath} from "../../src/data-objects/learning-paths/learning-path";
|
||||
import { LearningPathNode } from "@dwengo-1/backend/dist/entities/content/learning-path-node.entity";
|
||||
import { calculateProgress } from "../../src/utils/assignment-utils";
|
||||
import { LearningPath } from "../../src/data-objects/learning-paths/learning-path";
|
||||
import { describe, it, expect } from "vitest";
|
||||
|
||||
describe("calculateProgress", () => {
|
||||
|
@ -68,7 +68,6 @@ describe("calculateProgress", () => {
|
|||
expect(calculateProgress(lp)).toBeCloseTo(66.666, 2);
|
||||
});
|
||||
|
||||
|
||||
it("should handle edge case where amountOfNodesLeft is negative", () => {
|
||||
const lp = new LearningPath({
|
||||
language: "en",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue