From 2c5d3c04d0da053ae5e5a4661f795745875ad3d3 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Sat, 7 Jun 2025 18:26:15 +0100 Subject: [PATCH] CHORE: WIP unit test --- src/lib/data.ts | 4 +++- src/lib/types.ts | 28 +++++++++++++++++++---- tests/{git.test.js => git.svelte.test.ts} | 0 vite.config.ts | 5 +--- 4 files changed, 27 insertions(+), 10 deletions(-) rename tests/{git.test.js => git.svelte.test.ts} (100%) diff --git a/src/lib/data.ts b/src/lib/data.ts index 38ef0c9..556d217 100644 --- a/src/lib/data.ts +++ b/src/lib/data.ts @@ -1,4 +1,6 @@ -export async function getJson(path: string) { +import type {ContentTemplate} from "$lib/types" + +export async function getJson(path: string): Promise { let response = await fetch(path); let users = await response.json(); return users; diff --git a/src/lib/types.ts b/src/lib/types.ts index 92a7c3c..7e347c3 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -1,10 +1,28 @@ -export type TimelinePosition = 'right' | 'left' | 'alternate'; +export interface ContentTemplate { + name: string; + job_title: string; + location: string; + profile_photo: string; + about: string; -export type ParentPosition = 'right' | 'left'; + skills: Skill[]; + timeline: TimelineEvent[]; +} -export type TimelineConfig = { - rootPosition: TimelinePosition; -}; +export interface Skill { + name: string; + logo: string; + colour: string; + link: string; + about: string; + competency: number; +} + +export interface TimelineEvent { + duration: string; + title: string; + description: string; +} export interface GitRepo { name: string; diff --git a/tests/git.test.js b/tests/git.svelte.test.ts similarity index 100% rename from tests/git.test.js rename to tests/git.svelte.test.ts diff --git a/vite.config.ts b/vite.config.ts index 26a5bad..9363ff6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,8 +3,5 @@ import { defineConfig } from 'vite'; import tailwindcss from '@tailwindcss/vite'; export default defineConfig({ - plugins: [ - tailwindcss(), - sveltekit(), - ] + plugins: [tailwindcss(), sveltekit()], });