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