style: fix linting issues met ESLint

This commit is contained in:
Lint Action 2025-03-11 03:09:08 +00:00
parent a30c4d0d32
commit aa1a85e64e
24 changed files with 76 additions and 90 deletions

View file

@ -12,8 +12,8 @@ import {FilteredLearningObject} from "../../../src/interfaces/learning-content";
import {Language} from "../../../src/entities/content/language";
async function initExampleData(): Promise<LearningObject> {
let learningObjectRepo = getLearningObjectRepository();
let exampleLearningObject = createExampleLearningObjectWithAttachments(example);
const learningObjectRepo = getLearningObjectRepository();
const exampleLearningObject = createExampleLearningObjectWithAttachments(example);
await learningObjectRepo.insert(exampleLearningObject);
return exampleLearningObject;
}

View file

@ -18,7 +18,7 @@ const DWENGO_TEST_LEARNING_OBJECT_ID: LearningObjectIdentifier = {
async function initExampleData(): Promise<LearningObject> {
const learningObjectRepo = getLearningObjectRepository();
let learningObject = learningObjectExample.createLearningObject();
const learningObject = learningObjectExample.createLearningObject();
learningObject.title = TEST_LEARNING_OBJECT_TITLE
await learningObjectRepo.save(learningObject);
return learningObject;

View file

@ -14,8 +14,8 @@ import {Language} from "../../../src/entities/content/language";
async function initExampleData(): Promise<{ learningObject: LearningObject, learningPath: LearningPath }> {
const learningObjectRepo = getLearningObjectRepository();
const learningPathRepo = getLearningPathRepository();
let learningObject = learningObjectExample.createLearningObject();
let learningPath = learningPathExample.createLearningPath();
const learningObject = learningObjectExample.createLearningObject();
const learningPath = learningPathExample.createLearningPath();
await learningObjectRepo.save(learningObject);
await learningPathRepo.save(learningPath);
return { learningObject, learningPath };
@ -55,7 +55,7 @@ describe("DatabaseLearningPathProvider", () => {
it("returns a non-successful response if a non-existing learning path is queried", async () => {
const result = await databaseLearningPathProvider.fetchLearningPaths(
[example.learningPath.hruid],
Language.Abkhazian, // wrong language
Language.Abkhazian, // Wrong language
"the source"
);

View file

@ -11,8 +11,8 @@ import learningPathService from "../../../src/services/learning-paths/learning-p
async function initExampleData(): Promise<{ learningObject: LearningObject, learningPath: LearningPath }> {
const learningObjectRepo = getLearningObjectRepository();
const learningPathRepo = getLearningPathRepository();
let learningObject = learningObjectExample.createLearningObject();
let learningPath = learningPathExample.createLearningPath();
const learningObject = learningObjectExample.createLearningObject();
const learningPath = learningPathExample.createLearningPath();
await learningObjectRepo.save(learningObject);
await learningPathRepo.save(learningPath);
return { learningObject, learningPath };
@ -76,7 +76,7 @@ describe("LearningPathService", () => {
).length
).toBe(1);
// but should not only find that one.
// But should not only find that one.
expect(result.length).not.toBeLessThan(2);
});
it("should still return results from the Dwengo API even though there are no matches in the database", async () => {
@ -88,7 +88,7 @@ describe("LearningPathService", () => {
// Should find something...
expect(result.length).not.toBe(0);
// but not the example learning path.
// But not the example learning path.
expect(
result.filter(it =>
it.hruid === example.learningPath.hruid && it.title === example.learningPath.title