style: formatting and lints

Auth is still problematic, but that's a known issue
This commit is contained in:
Roman Godmaire 2024-02-11 08:33:30 -05:00
parent a0e8c5829b
commit be1b61f831

View file

@ -4,9 +4,11 @@ import { actions } from './+page.server';
import { v4 as uuidv4 } from 'uuid';
import { MockGenericDatabase } from '$lib/server/db/mock';
import { NoopFileStore } from '$lib/server/storage/noop';
const baseLocals = {
// TODO: Replace with authentication adapter
auth: null,
authReq: {
validate: () => {
return {
@ -16,12 +18,14 @@ const baseLocals = {
};
}
},
database: new MockGenericDatabase()
database: new MockGenericDatabase(),
readStore: new NoopFileStore(),
writeStore: new NoopFileStore()
};
const baseRequest = {
formData: async () => {
let formData = new FormData();
const formData = new FormData();
formData.append('comment', 'uwu');
return formData;
}
@ -49,7 +53,7 @@ test('create comment -- id', async () => {
test('create comment -- id does not exist', async () => {
expect(async () => {
let locals = baseLocals;
const locals = baseLocals;
locals.database.getLatestTrackVersion = async () => {
return null;
};
@ -74,7 +78,7 @@ test('create comment -- not uuid or id', async () => {
});
test('create comment -- not logged in', async () => {
let locals = baseLocals;
const locals = baseLocals;
locals.authReq = {
validate: () => {
return null;