style: fix linting issues met Prettier
This commit is contained in:
parent
1b18338c78
commit
ba617a43e7
11 changed files with 46 additions and 30 deletions
|
@ -17,7 +17,7 @@ export async function initORM(testingMode = false): Promise<MikroORM<IDatabaseDr
|
|||
|
||||
// Update the database scheme if necessary and enabled.
|
||||
if (getEnvVar(envVars.DbUpdate)) {
|
||||
logger.info("MikroORM: Updating database schema");
|
||||
logger.info('MikroORM: Updating database schema');
|
||||
await orm.schema.updateSchema();
|
||||
} else {
|
||||
const diff = await orm.schema.getUpdateSchemaSQL();
|
||||
|
|
|
@ -29,7 +29,11 @@ describe('SubmissionRepository', () => {
|
|||
|
||||
it('should find the requested submission', async () => {
|
||||
const usedSubmission = getSubmission01();
|
||||
const id = new LearningObjectIdentifier(usedSubmission.learningObjectHruid, usedSubmission.learningObjectLanguage, usedSubmission.learningObjectVersion);
|
||||
const id = new LearningObjectIdentifier(
|
||||
usedSubmission.learningObjectHruid,
|
||||
usedSubmission.learningObjectLanguage,
|
||||
usedSubmission.learningObjectVersion
|
||||
);
|
||||
const submission = await submissionRepository.findSubmissionByLearningObjectAndSubmissionNumber(id, usedSubmission.submissionNumber!);
|
||||
|
||||
expect(submission).toBeTruthy();
|
||||
|
@ -40,8 +44,12 @@ describe('SubmissionRepository', () => {
|
|||
|
||||
it('should find the most recent submission for a student', async () => {
|
||||
const usedSubmission = getSubmission02();
|
||||
const id = new LearningObjectIdentifier(usedSubmission.learningObjectHruid, usedSubmission.learningObjectLanguage, usedSubmission.learningObjectVersion);
|
||||
|
||||
const id = new LearningObjectIdentifier(
|
||||
usedSubmission.learningObjectHruid,
|
||||
usedSubmission.learningObjectLanguage,
|
||||
usedSubmission.learningObjectVersion
|
||||
);
|
||||
|
||||
const submission = await submissionRepository.findMostRecentSubmissionForStudent(id, usedSubmission.submitter);
|
||||
|
||||
expect(submission).toBeTruthy();
|
||||
|
@ -50,8 +58,12 @@ describe('SubmissionRepository', () => {
|
|||
|
||||
it('should find the most recent submission for a group', async () => {
|
||||
const usedSubmission = getSubmission02();
|
||||
const id = new LearningObjectIdentifier(usedSubmission.learningObjectHruid, usedSubmission.learningObjectLanguage, usedSubmission.learningObjectVersion);
|
||||
|
||||
const id = new LearningObjectIdentifier(
|
||||
usedSubmission.learningObjectHruid,
|
||||
usedSubmission.learningObjectLanguage,
|
||||
usedSubmission.learningObjectVersion
|
||||
);
|
||||
|
||||
const submission = await submissionRepository.findMostRecentSubmissionForGroup(id, usedSubmission.onBehalfOf);
|
||||
|
||||
expect(submission).toBeTruthy();
|
||||
|
@ -61,7 +73,7 @@ describe('SubmissionRepository', () => {
|
|||
it('should find all submissions for a certain learning object and assignment', async () => {
|
||||
const usedSubmission = getSubmission08();
|
||||
const assignment = getAssignment01();
|
||||
|
||||
|
||||
const loId = {
|
||||
hruid: usedSubmission.learningObjectHruid,
|
||||
language: usedSubmission.learningObjectLanguage,
|
||||
|
|
|
@ -48,7 +48,6 @@ describe('ClassRepository', () => {
|
|||
expect(invitations).toHaveLength(2);
|
||||
expect(invitations[0].class.classId).toBeOneOf([ti1.class.classId, ti2.class.classId]);
|
||||
expect(invitations[1].class.classId).toBeOneOf([ti1.class.classId, ti2.class.classId]);
|
||||
|
||||
});
|
||||
|
||||
it('should not find a removed invitation', async () => {
|
||||
|
|
|
@ -49,8 +49,6 @@ describe('LearningObjectRepository', () => {
|
|||
});
|
||||
|
||||
it('should return the newest version of the learning object when queried by only hruid and language', async () => {
|
||||
|
||||
|
||||
const result = await learningObjectRepository.findLatestByHruidAndLanguage(newerExample.hruid, newerExample.language);
|
||||
// Expect(result).toBeInstanceOf(LearningObject);
|
||||
// Expect(result?.version).toBe(10);
|
||||
|
|
|
@ -106,34 +106,34 @@ let submission06: Submission;
|
|||
let submission07: Submission;
|
||||
let submission08: Submission;
|
||||
|
||||
export function getSubmission01(): Submission{
|
||||
export function getSubmission01(): Submission {
|
||||
return submission01;
|
||||
}
|
||||
|
||||
export function getSubmission02(): Submission{
|
||||
export function getSubmission02(): Submission {
|
||||
return submission02;
|
||||
}
|
||||
|
||||
export function getSubmission03(): Submission{
|
||||
export function getSubmission03(): Submission {
|
||||
return submission03;
|
||||
}
|
||||
|
||||
export function getSubmission04(): Submission{
|
||||
export function getSubmission04(): Submission {
|
||||
return submission04;
|
||||
}
|
||||
|
||||
export function getSubmission05(): Submission{
|
||||
export function getSubmission05(): Submission {
|
||||
return submission05;
|
||||
}
|
||||
|
||||
export function getSubmission06(): Submission{
|
||||
export function getSubmission06(): Submission {
|
||||
return submission06;
|
||||
}
|
||||
|
||||
export function getSubmission07(): Submission{
|
||||
export function getSubmission07(): Submission {
|
||||
return submission07;
|
||||
}
|
||||
|
||||
export function getSubmission08(): Submission{
|
||||
export function getSubmission08(): Submission {
|
||||
return submission08;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,18 +37,18 @@ let classJoinRequest02: ClassJoinRequest;
|
|||
let classJoinRequest03: ClassJoinRequest;
|
||||
let classJoinRequest04: ClassJoinRequest;
|
||||
|
||||
export function getClassJoinRequest01(): ClassJoinRequest{
|
||||
export function getClassJoinRequest01(): ClassJoinRequest {
|
||||
return classJoinRequest01;
|
||||
}
|
||||
|
||||
export function getClassJoinRequest02(): ClassJoinRequest{
|
||||
export function getClassJoinRequest02(): ClassJoinRequest {
|
||||
return classJoinRequest02;
|
||||
}
|
||||
|
||||
export function getClassJoinRequest03(): ClassJoinRequest{
|
||||
export function getClassJoinRequest03(): ClassJoinRequest {
|
||||
return classJoinRequest03;
|
||||
}
|
||||
|
||||
export function getClassJoinRequest04(): ClassJoinRequest{
|
||||
export function getClassJoinRequest04(): ClassJoinRequest {
|
||||
return classJoinRequest04;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,4 +56,4 @@ export function getTeacherInvitation03(): TeacherInvitation {
|
|||
|
||||
export function getTeacherInvitation04(): TeacherInvitation {
|
||||
return teacherInvitation04;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,6 @@ export function makeTestAttachments(em: EntityManager): Attachment[] {
|
|||
|
||||
let attachment01: Attachment;
|
||||
|
||||
export function getAttachment01(): Attachment{
|
||||
export function getAttachment01(): Attachment {
|
||||
return attachment01;
|
||||
}
|
||||
|
|
|
@ -72,4 +72,4 @@ export function getAnswer04(): Answer {
|
|||
|
||||
export function getAnswer05(): Answer {
|
||||
return answer05;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
import { EntityManager } from '@mikro-orm/core';
|
||||
import { Question } from '../../../src/entities/questions/question.entity';
|
||||
import { getDireStraits, getNoordkaap, getTestleerling1, getTool } from '../users/students.testdata';
|
||||
import { testLearningObject01, testLearningObject04, testLearningObject05, testLearningObjectMultipleChoice } from '../content/learning-objects.testdata';
|
||||
import {
|
||||
testLearningObject01,
|
||||
testLearningObject04,
|
||||
testLearningObject05,
|
||||
testLearningObjectMultipleChoice,
|
||||
} from '../content/learning-objects.testdata';
|
||||
import { getGroup1ConditionalLearningPath, getTestGroup01, getTestGroup02 } from '../assignments/groups.testdata';
|
||||
|
||||
export function makeTestQuestions(em: EntityManager): Question[] {
|
||||
|
@ -130,7 +135,6 @@ export function getQuestion06(): Question {
|
|||
return question06;
|
||||
}
|
||||
|
||||
|
||||
export function getQuestion07(): Question {
|
||||
return question07;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,10 @@ import { seedORM } from './seedORM.js';
|
|||
|
||||
const logger: Logger = getLogger();
|
||||
|
||||
export async function seedDatabase(envFile = '.env.development.local', testMode = process.env.NODE_ENV !== undefined && process.env.NODE_ENV === 'test'): Promise<void> {
|
||||
export async function seedDatabase(
|
||||
envFile = '.env.development.local',
|
||||
testMode = process.env.NODE_ENV !== undefined && process.env.NODE_ENV === 'test'
|
||||
): Promise<void> {
|
||||
dotenv.config({ path: envFile });
|
||||
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue