style: fix linting issues met ESLint

This commit is contained in:
Lint Action 2025-03-11 10:59:51 +00:00
parent 31f994167d
commit dd21f46162
3 changed files with 6 additions and 8 deletions

View file

@ -112,9 +112,9 @@ async function convertNodes(
function optionalJsonStringToObject(jsonString?: string): object | null { function optionalJsonStringToObject(jsonString?: string): object | null {
if (!jsonString) { if (!jsonString) {
return null; return null;
} else { }
return JSON.parse(jsonString); return JSON.parse(jsonString);
}
} }
/** /**

View file

@ -94,7 +94,7 @@ function expectBranchingObjectNode(result: LearningPathResponse, persTestData: {
studentA: Student; studentA: Student;
studentB: Student studentB: Student
}): LearningObjectNode { }): LearningObjectNode {
let branchingObjectMatches = result.data![0].nodes.filter( const branchingObjectMatches = result.data![0].nodes.filter(
it => it.learningobject_hruid === persTestData.learningContent.branchingObject.hruid it => it.learningobject_hruid === persTestData.learningContent.branchingObject.hruid
); );
expect(branchingObjectMatches.length).toBe(1); expect(branchingObjectMatches.length).toBe(1);
@ -156,7 +156,7 @@ describe('DatabaseLearningPathProvider', () => {
.transitions .transitions
.filter(it => it.next.hruid === persTestData.learningContent.finalObject.hruid) .filter(it => it.next.hruid === persTestData.learningContent.finalObject.hruid)
.length .length
).toBe(0); // studentA picked the first option, therefore, there should be no direct path to the final object. ).toBe(0); // StudentA picked the first option, therefore, there should be no direct path to the final object.
expect( expect(
branchingObject branchingObject
.transitions .transitions
@ -183,7 +183,7 @@ describe('DatabaseLearningPathProvider', () => {
.transitions .transitions
.filter(it => it.next.hruid === persTestData.learningContent.finalObject.hruid) .filter(it => it.next.hruid === persTestData.learningContent.finalObject.hruid)
.length .length
).toBe(1); // studentB picked the second option, therefore, there should be a direct path to the final object. ).toBe(1); // StudentB picked the second option, therefore, there should be a direct path to the final object.
expect( expect(
branchingObject branchingObject
.transitions .transitions

View file

@ -80,7 +80,5 @@ export function createConditionTestLearningPathAndLearningObjects(){
} }
const example: LearningPathExample = { const example: LearningPathExample = {
createLearningPath: () => { createLearningPath: () => createConditionTestLearningPathAndLearningObjects().learningPath,
return createConditionTestLearningPathAndLearningObjects().learningPath;
},
}; };