mirror of
https://github.com/Xevion/Pac-Man.git
synced 2026-01-31 06:25:09 -06:00
fix: address ESLint warnings and add Vitest configuration
- Add ESLint flat config with Svelte and TypeScript support - Fix unused variables and component prop naming - Add Vitest browser testing setup with Playwright - Configure separate test projects for client and server code
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
|
||||
describe('sum test', () => {
|
||||
it('adds 1 + 2 to equal 3', () => {
|
||||
expect(1 + 2).toBe(3);
|
||||
});
|
||||
});
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
let {
|
||||
href,
|
||||
icon,
|
||||
icon: Icon,
|
||||
label,
|
||||
active = false,
|
||||
size = 18
|
||||
@@ -23,6 +23,6 @@
|
||||
</script>
|
||||
|
||||
<a {href} class={navLinkClass(active)}>
|
||||
<icon {size}></icon>
|
||||
<Icon {size} />
|
||||
<span>{label}</span>
|
||||
</a>
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
</div>
|
||||
|
||||
<div class="absolute right-4 hidden sm:flex gap-4 items-center">
|
||||
{#each sourceLinks as link}
|
||||
{#each sourceLinks as link (link.href)}
|
||||
<a
|
||||
href={link.href}
|
||||
title={link.label}
|
||||
@@ -266,7 +266,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex flex-col gap-3">
|
||||
{#each links as link}
|
||||
{#each links as link (link.href)}
|
||||
<NavLink
|
||||
href={link.href}
|
||||
icon={link.icon}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
function handleKeyDown(e: KeyboardEvent) {
|
||||
function handleKeyDown() {
|
||||
if (!gameReady || gameStarted) return;
|
||||
handleInteraction();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { page } from 'vitest/browser';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { render } from 'vitest-browser-svelte';
|
||||
import Page from './+page.svelte';
|
||||
|
||||
describe('/+page.svelte', () => {
|
||||
it('should render h1', async () => {
|
||||
render(Page);
|
||||
|
||||
const heading = page.getByRole('heading', { level: 1 });
|
||||
await expect.element(heading).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user